PhoneNumber.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\en_IN; |
| 4 | |
| 5 | class PhoneNumber extends \Faker\Provider\PhoneNumber |
| 6 | { |
| 7 | protected static $formats = array( |
| 8 | '+91 ## ########', |
| 9 | '+91 ### #######', |
| 10 | '0## ########', |
| 11 | '0### #######' |
| 12 | ); |
| 13 | |
| 14 | /** |
| 15 | * An array of en_IN mobile (cell) phone number formats |
| 16 | * @var array |
| 17 | */ |
| 18 | protected static $mobileFormats = array( |
| 19 | '+91 9#########', |
| 20 | '+91 8#########', |
| 21 | '+91 7#########', |
| 22 | '09#########', |
| 23 | '08#########', |
| 24 | '07#########' |
| 25 | ); |
| 26 | |
| 27 | /** |
| 28 | * Return a en_IN mobile phone number |
| 29 | * @return string |
| 30 | */ |
| 31 | public static function mobileNumber() |
| 32 | { |
| 33 | return static::numerify(static::randomElement(static::$mobileFormats)); |
| 34 | } |
| 35 | } |
| 36 |