Address.php
5 years ago
Company.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
PhoneNumber.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\nb_NO; |
| 4 | |
| 5 | class PhoneNumber extends \Faker\Provider\PhoneNumber |
| 6 | { |
| 7 | /** |
| 8 | * @var array Norwegian phone number formats |
| 9 | */ |
| 10 | protected static $formats = array( |
| 11 | '+47#########', |
| 12 | '+47 ## ## ## ##', |
| 13 | '## ## ## ##', |
| 14 | '## ## ## ##', |
| 15 | '########', |
| 16 | '########', |
| 17 | '9## ## ###', |
| 18 | '4## ## ###', |
| 19 | '9#######', |
| 20 | '4#######', |
| 21 | ); |
| 22 | |
| 23 | /** |
| 24 | * @var array Norweign mobile number formats |
| 25 | */ |
| 26 | protected static $mobileFormats = array( |
| 27 | '+474#######', |
| 28 | '+479#######', |
| 29 | '9## ## ###', |
| 30 | '4## ## ###', |
| 31 | '9#######', |
| 32 | '4#######', |
| 33 | ); |
| 34 | |
| 35 | public function mobileNumber() |
| 36 | { |
| 37 | $format = static::randomElement(static::$mobileFormats); |
| 38 | |
| 39 | return self::numerify($this->generator->parse($format)); |
| 40 | } |
| 41 | } |
| 42 |