Address.php
5 years ago
Color.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
48 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\es_ES; |
| 4 | |
| 5 | class PhoneNumber extends \Faker\Provider\PhoneNumber |
| 6 | { |
| 7 | protected static $formats = array( |
| 8 | '+34 9## ## ####', |
| 9 | '+34 9## ######', |
| 10 | '+34 9########', |
| 11 | '+34 9##-##-####', |
| 12 | '+34 9##-######', |
| 13 | '9## ## ####', |
| 14 | '9## ######', |
| 15 | '9########', |
| 16 | '9##-##-####', |
| 17 | '9##-######', |
| 18 | ); |
| 19 | |
| 20 | protected static $mobileFormats = array( |
| 21 | '+34 6## ## ####', |
| 22 | '+34 6## ######', |
| 23 | '+34 6########', |
| 24 | '+34 6##-##-####', |
| 25 | '+34 6##-######', |
| 26 | '6## ## ####', |
| 27 | '6## ######', |
| 28 | '6########', |
| 29 | '6##-##-####', |
| 30 | '6##-######', |
| 31 | ); |
| 32 | |
| 33 | protected static $tollFreeFormats = array( |
| 34 | '900 ### ###', |
| 35 | '800 ### ###', |
| 36 | ); |
| 37 | |
| 38 | public static function mobileNumber() |
| 39 | { |
| 40 | return static::numerify(static::randomElement(static::$mobileFormats)); |
| 41 | } |
| 42 | |
| 43 | public static function tollFreeNumber() |
| 44 | { |
| 45 | return static::numerify(static::randomElement(static::$tollFreeFormats)); |
| 46 | } |
| 47 | } |
| 48 |