Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Rename norwegian locale
Browse files Browse the repository at this point in the history
Closes #854
  • Loading branch information
fzaninotto committed Apr 29, 2016
1 parent 026bd4f commit 29f04a6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Faker\Provider\no_NO;
namespace Faker\Provider\nb_NO;

class Address extends \Faker\Provider\Address
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Faker\Provider\no_NO;
namespace Faker\Provider\nb_NO;

class Company extends \Faker\Provider\Company
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Faker\Provider\no_NO;
namespace Faker\Provider\nb_NO;

class Payment extends \Faker\Provider\Payment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Faker\Provider\no_NO;
namespace Faker\Provider\nb_NO;

class Person extends \Faker\Provider\Person
{
Expand Down Expand Up @@ -293,13 +293,13 @@ public function personalIdentityNumber(\DateTime $birthdate = null, $gender = nu
$birthdate = \Faker\Provider\DateTime::dateTimeThisCentury();
}
$datePart = $birthdate->format('dmy');

/**
* @todo These number should be random based on birth year
* @link http://no.wikipedia.org/wiki/F%C3%B8dselsnummer
*/
$randomDigits = (string)static::numerify('##');

switch($gender) {
case static::GENDER_MALE:
$genderDigit = static::randomElement(array(1,3,5,7,9));
Expand All @@ -310,16 +310,16 @@ public function personalIdentityNumber(\DateTime $birthdate = null, $gender = nu
default:
$genderDigit = (string)static::numerify('#');
}


$digits = $datePart.$randomDigits.$genderDigit;

/**
* @todo Calculate modulo 11 of $digits
* @link http://no.wikipedia.org/wiki/F%C3%B8dselsnummer
*/
$checksum = (string)static::numerify('##');


return $digits.$checksum;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Faker\Provider\no_NO;
namespace Faker\Provider\nb_NO;

class PhoneNumber extends \Faker\Provider\PhoneNumber
{
Expand Down

0 comments on commit 29f04a6

Please sign in to comment.