Address.php
5 years ago
Company.php
5 years ago
Internet.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
Text.php
5 years ago
PhoneNumber.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\de_CH; |
| 4 | |
| 5 | class PhoneNumber extends \Faker\Provider\PhoneNumber |
| 6 | { |
| 7 | protected static $formats = array( |
| 8 | '+41 (0)## ### ## ##', |
| 9 | '+41(0)#########', |
| 10 | '+41 ## ### ## ##', |
| 11 | '0#########', |
| 12 | '0## ### ## ##', |
| 13 | ); |
| 14 | |
| 15 | /** |
| 16 | * An array of Swiss mobile (cell) phone number formats. |
| 17 | * |
| 18 | * @var array |
| 19 | */ |
| 20 | protected static $mobileFormats = array( |
| 21 | // Local |
| 22 | '075 ### ## ##', |
| 23 | '075#######', |
| 24 | '076 ### ## ##', |
| 25 | '076#######', |
| 26 | '077 ### ## ##', |
| 27 | '077#######', |
| 28 | '078 ### ## ##', |
| 29 | '078#######', |
| 30 | '079 ### ## ##', |
| 31 | '079#######', |
| 32 | ); |
| 33 | |
| 34 | /** |
| 35 | * Return a Swiss mobile phone number. |
| 36 | * |
| 37 | * @return string |
| 38 | */ |
| 39 | public static function mobileNumber() |
| 40 | { |
| 41 | return static::numerify(static::randomElement(static::$mobileFormats)); |
| 42 | } |
| 43 | } |
| 44 |