Address.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\es_PE; |
| 4 | |
| 5 | class Address extends \Faker\Provider\es_ES\Address |
| 6 | { |
| 7 | protected static $cityPrefix = array('San', 'Puerto', 'Gral.', 'Don'); |
| 8 | protected static $citySuffix = array('Alta', 'Baja', 'Norte', 'Este', ' Sur', ' Oeste'); |
| 9 | protected static $buildingNumber = array('#####', '####', '###', '##', '#'); |
| 10 | protected static $streetPrefix = array('Jr.', 'Av.', 'Cl.', 'Urb.' ); |
| 11 | protected static $streetSuffix = array(''); |
| 12 | protected static $postcode = array('LIMA ##'); |
| 13 | protected static $state = array( |
| 14 | 'Lima', 'Callao', 'Arequipa', 'Cuzco', 'Piura', 'Iquitos', 'Huaraz', 'Tacna', 'Ayacucho', 'Pucallpa', 'Trujillo', 'Chimbote', 'Ica', 'Moquegua', 'Puno', 'Tarapoto', 'Cajamarca', 'Lambayeque', 'Huanuco', 'Jauja', 'Tumbes', 'Madre de Dios' |
| 15 | ); |
| 16 | protected static $cityFormats = array( |
| 17 | '{{cityPrefix}} {{firstName}} {{lastName}}', |
| 18 | '{{cityPrefix}} {{firstName}}', |
| 19 | '{{firstName}} {{citySuffix}}', |
| 20 | '{{lastName}} {{citySuffix}}', |
| 21 | ); |
| 22 | protected static $streetNameFormats = array( |
| 23 | '{{streetPrefix}} {{firstName}} {{lastName}}', |
| 24 | ); |
| 25 | protected static $streetAddressFormats = array( |
| 26 | '{{streetName}} # {{buildingNumber}} ', |
| 27 | '{{streetName}} # {{buildingNumber}} {{secondaryAddress}}', |
| 28 | ); |
| 29 | protected static $addressFormats = array( |
| 30 | "{{streetAddress}}\n{{city}}, {{state}}", |
| 31 | ); |
| 32 | protected static $secondaryAddressFormats = array('Dpto. ###', 'Hab. ###', 'Piso #', 'Piso ##'); |
| 33 | |
| 34 | /** |
| 35 | * @example '' |
| 36 | */ |
| 37 | public static function cityPrefix() |
| 38 | { |
| 39 | return static::randomElement(static::$cityPrefix); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @example 'Jr.' |
| 44 | */ |
| 45 | public static function streetPrefix() |
| 46 | { |
| 47 | return static::randomElement(static::$streetPrefix); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @example 'Dpto. 402' |
| 52 | */ |
| 53 | public static function secondaryAddress() |
| 54 | { |
| 55 | return static::numerify(static::randomElement(static::$secondaryAddressFormats)); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @example 'Lima' |
| 60 | */ |
| 61 | public static function state() |
| 62 | { |
| 63 | return static::randomElement(static::$state); |
| 64 | } |
| 65 | } |
| 66 |