PhoneNumber.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\en_HK; |
| 4 | |
| 5 | class PhoneNumber extends \Faker\Provider\PhoneNumber |
| 6 | { |
| 7 | protected static $formats = array('2#######', '3#######', '5#######', '6#######', '9#######'); |
| 8 | protected static $mobileFormats = array('5#######', '6#######', '9#######'); |
| 9 | protected static $landlineFormats = array('2#######', '3#######'); |
| 10 | protected static $faxFormats = array('7#######'); |
| 11 | |
| 12 | /** |
| 13 | * Return an en_HK mobile phone number |
| 14 | * @return string |
| 15 | */ |
| 16 | public static function mobileNumber() |
| 17 | { |
| 18 | return static::numerify(static::randomElement(static::$mobileFormats)); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Return an en_HK landline number |
| 23 | * @return string |
| 24 | */ |
| 25 | public static function landlineNumber() |
| 26 | { |
| 27 | return static::numerify(static::randomElement(static::$landlineFormats)); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Return an en_HK fax number |
| 32 | * @return string |
| 33 | */ |
| 34 | public static function faxNumber() |
| 35 | { |
| 36 | return static::numerify(static::randomElement(static::$faxFormats)); |
| 37 | } |
| 38 | } |
| 39 |