Address.php
79 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\en_NZ; |
| 4 | |
| 5 | class Address extends \Faker\Provider\en_US\Address |
| 6 | { |
| 7 | |
| 8 | /** |
| 9 | * An array of en_NZ (New Zealand) building number formats |
| 10 | * @var array |
| 11 | */ |
| 12 | protected static $buildingNumber = array('#', '##', '###'); |
| 13 | |
| 14 | /** |
| 15 | * An array of en_NZ (New Zealand) street suffixes |
| 16 | * @var array |
| 17 | */ |
| 18 | protected static $streetSuffix = array( |
| 19 | 'Avenue', 'Close', 'Court', 'Crescent', 'Drive', 'Esplanade', 'Grove', 'Heights', 'Highway', 'Hill', 'Lane', 'Line', 'Mall', 'Parade', 'Place', 'Quay', 'Rise', 'Road', 'Square', 'Street', 'Terrace', 'Way' |
| 20 | ); |
| 21 | |
| 22 | /** |
| 23 | * City suffixes |
| 24 | * @var array |
| 25 | */ |
| 26 | protected static $citySuffix = array('ville', 'ston'); |
| 27 | |
| 28 | /** |
| 29 | * City formats |
| 30 | * @var array |
| 31 | */ |
| 32 | protected static $cityFormats = array('{{firstName}}{{citySuffix}}'); |
| 33 | |
| 34 | /** |
| 35 | * An array of en_NZ (New Zealand) regions |
| 36 | * @see http://en.wikipedia.org/wiki/Regions_of_New_Zealand |
| 37 | * @var array |
| 38 | */ |
| 39 | protected static $region = array( |
| 40 | 'Auckland', 'Bay of Plenty', 'Canterbury', 'Gisborne', 'Hawkes Bay', 'Manawatu-Whanganui', 'Marlborough', 'Nelson', 'Northland', 'Otago', 'Southland', 'Taranaki', 'Tasman', 'Waikato', 'Wellington', 'West Coast' |
| 41 | ); |
| 42 | |
| 43 | /** |
| 44 | * An array of en_NZ (New Zealand) poscode formats |
| 45 | * @var array |
| 46 | */ |
| 47 | protected static $postcode = array('####'); |
| 48 | |
| 49 | /** |
| 50 | * An array of en_NZ (New Zealand) address formats |
| 51 | * @var array |
| 52 | */ |
| 53 | protected static $addressFormats = array('{{buildingNumber}} {{streetName}}, {{city}}, {{region}}, {{postcode}}'); |
| 54 | |
| 55 | /** |
| 56 | * An array of en_NZ (New Zealand) street address formats |
| 57 | * @var array |
| 58 | */ |
| 59 | protected static $streetAddressFormats = array('{{buildingNumber}} {{streetName}}'); |
| 60 | |
| 61 | /** |
| 62 | * Return a en_NZ (New Zealand) postcode |
| 63 | * @return string |
| 64 | */ |
| 65 | public static function postcode() |
| 66 | { |
| 67 | return static::numerify(static::randomElement(static::$postcode)); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Return a en_NZ (New Zealand) region |
| 72 | * @return string |
| 73 | */ |
| 74 | public static function region() |
| 75 | { |
| 76 | return static::randomElement(static::$region); |
| 77 | } |
| 78 | } |
| 79 |