| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Faker\Provider\en_SG;
|
|
|
4 |
|
|
|
5 |
class Address extends \Faker\Provider\Address
|
|
|
6 |
{
|
|
|
7 |
// http://en.wikipedia.org/wiki/Singapore_Post#Address_format
|
|
|
8 |
protected static $streetNumber = ['##', '###'];
|
|
|
9 |
|
|
|
10 |
// http://en.wikipedia.org/wiki/Singapore_Post#Address_format
|
|
|
11 |
protected static $blockNumber = [
|
|
|
12 |
'Blk ##',
|
|
|
13 |
'Blk ###',
|
|
|
14 |
'Blk ###A',
|
|
|
15 |
'Blk ###B',
|
|
|
16 |
'Blk ###C',
|
|
|
17 |
'Blk ###D',
|
|
|
18 |
'Blk ###E',
|
|
|
19 |
'Blk ###F',
|
|
|
20 |
'Blk ###G',
|
|
|
21 |
'Blk ###H',
|
|
|
22 |
];
|
|
|
23 |
|
|
|
24 |
// http://www.streetdirectory.com/asia_travel/travel/street/alphabet2/
|
|
|
25 |
protected static $streetSuffix = [
|
|
|
26 |
'Alley', 'Avenue',
|
|
|
27 |
'Bridge',
|
|
|
28 |
'Crescent',
|
|
|
29 |
'Drive',
|
|
|
30 |
'Grove',
|
|
|
31 |
'Highway', 'Hill',
|
|
|
32 |
'Lane', 'Link',
|
|
|
33 |
'Park', 'Place',
|
|
|
34 |
'Quay',
|
|
|
35 |
'Road',
|
|
|
36 |
'Walk', 'Way',
|
|
|
37 |
];
|
|
|
38 |
|
|
|
39 |
// http://www.streetdirectory.com/asia_travel/travel/street/alphabet2/
|
|
|
40 |
protected static $streetPrefix = [
|
|
|
41 |
'Jalan',
|
|
|
42 |
];
|
|
|
43 |
|
|
|
44 |
// http://www.streetdirectory.com/asia_travel/travel/street/alphabet2/
|
|
|
45 |
// http://remembersingapore.org/2011/04/04/old-names-of-places/
|
|
|
46 |
protected static $streetName = [
|
|
|
47 |
'Adam', 'Airport', 'Alexandra', 'Aljunied', 'Ampang', 'Ann Siang', 'Angus', 'Anson', 'Armenian',
|
|
|
48 |
'Balmoral', 'Battery', 'Bencoolen',
|
|
|
49 |
'Collyer', 'Clarke', 'Church', 'Cecil', 'Cross', 'Chulia', 'Cheang Hong Lim', 'Chin Swee', 'Choon Guan',
|
|
|
50 |
'Devonshire', 'Dublin', 'Duxton', 'D\'Almeida',
|
|
|
51 |
'East Coast', 'Eden', 'Edgware', 'Eunos',
|
|
|
52 |
'Fifth', 'First', 'Funan', 'Fullerton',
|
|
|
53 |
'George', 'Glasgow', 'Grange',
|
|
|
54 |
'Havelock', 'High', 'Hylam',
|
|
|
55 |
'International Business', 'International', 'Irving',
|
|
|
56 |
'Jubilee',
|
|
|
57 |
'Kensington Park', 'Kitchener', 'Knights',
|
|
|
58 |
'Lancaster', 'Leicester', 'Lengkok Bahru', 'Lim Teck Kim',
|
|
|
59 |
'Malay', 'Market', 'Middle', 'Malabar', 'Merchant', 'Mohammed Sultan',
|
|
|
60 |
'Napier', 'Nathan', 'Newton',
|
|
|
61 |
'Ocean', 'One Tree', 'Orchard', 'Outram', 'Ophir',
|
|
|
62 |
'Pekin', 'Peng Siang', 'Prince Edward', 'Palmer',
|
|
|
63 |
'Quality', 'Queen',
|
|
|
64 |
'Raffles', 'Robinson', 'Rochor', 'Regent', 'Ridley', 'River Valley',
|
|
|
65 |
'Sixth', 'Somerset', 'Stanley', 'Stamford', 'Shenton', 'Sultan',
|
|
|
66 |
'Telok Ayer', 'Temple', 'Thomson', 'Unity', 'Victoria', 'Xilin', 'York', 'Zion',
|
|
|
67 |
];
|
|
|
68 |
|
|
|
69 |
protected static $streetAddressFormats = [
|
|
|
70 |
'{{streetPrefix}} {{streetName}}',
|
|
|
71 |
'{{streetName}} {{streetSuffix}}',
|
|
|
72 |
];
|
|
|
73 |
|
|
|
74 |
protected static $floorNumber = [
|
|
|
75 |
'##', '0#',
|
|
|
76 |
];
|
|
|
77 |
|
|
|
78 |
protected static $apartmentNumber = [
|
|
|
79 |
'##', '###',
|
|
|
80 |
];
|
|
|
81 |
|
|
|
82 |
// http://en.wikipedia.org/wiki/Singapore_Post#Address_format
|
|
|
83 |
protected static $addressFormats = [
|
|
|
84 |
"{{streetNumber}} {{streetAddress}}\n{{townName}} {{postcode}}",
|
|
|
85 |
"{{blockNumber}} {{streetAddress}}\n{{floorNumber}} {{apartmentNumber}}\n{{townName}} {{postcode}}",
|
|
|
86 |
];
|
|
|
87 |
|
|
|
88 |
protected static $townName = 'SINGAPORE';
|
|
|
89 |
|
|
|
90 |
protected static $postcode = ['######'];
|
|
|
91 |
|
|
|
92 |
protected static $country = [
|
|
|
93 |
'SINGAPORE',
|
|
|
94 |
];
|
|
|
95 |
|
|
|
96 |
public function streetPrefix()
|
|
|
97 |
{
|
|
|
98 |
return static::randomElement(static::$streetPrefix);
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
public function streetNumber()
|
|
|
102 |
{
|
|
|
103 |
return static::numerify(static::randomElement(static::$streetNumber));
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
public function blockNumber()
|
|
|
107 |
{
|
|
|
108 |
return static::numerify(static::randomElement(static::$blockNumber));
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
public function floorNumber()
|
|
|
112 |
{
|
|
|
113 |
return static::randomElement(static::$floorNumber);
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
public function apartmentNumber()
|
|
|
117 |
{
|
|
|
118 |
return static::randomElement(static::$apartmentNumber);
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
public function townName()
|
|
|
122 |
{
|
|
|
123 |
return static::$townName;
|
|
|
124 |
}
|
|
|
125 |
}
|