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

[RFR] Rename norwegian locale #901

Merged
merged 1 commit into from
Apr 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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