1 | <?php |
||
20 | class Address implements Location |
||
21 | { |
||
22 | /** |
||
23 | * @var Coordinates|null |
||
24 | */ |
||
25 | private $coordinates; |
||
26 | |||
27 | /** |
||
28 | * @var Bounds|null |
||
29 | */ |
||
30 | private $bounds; |
||
31 | |||
32 | /** |
||
33 | * @var string|int|null |
||
34 | */ |
||
35 | private $streetNumber; |
||
36 | |||
37 | /** |
||
38 | * @var string|null |
||
39 | */ |
||
40 | private $streetName; |
||
41 | |||
42 | /** |
||
43 | * @var string|null |
||
44 | */ |
||
45 | private $subLocality; |
||
46 | |||
47 | /** |
||
48 | * @var string|null |
||
49 | */ |
||
50 | private $locality; |
||
51 | |||
52 | /** |
||
53 | * @var string|null |
||
54 | */ |
||
55 | private $postalCode; |
||
56 | |||
57 | /** |
||
58 | * @var AdminLevelCollection |
||
59 | */ |
||
60 | private $adminLevels; |
||
61 | |||
62 | /** |
||
63 | * @var Country|null |
||
64 | */ |
||
65 | private $country; |
||
66 | |||
67 | /** |
||
68 | * @var string|null |
||
69 | */ |
||
70 | private $timezone; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | private $providedBy; |
||
76 | |||
77 | /** |
||
78 | * @param string $providedBy |
||
79 | * @param AdminLevelCollection $adminLevels |
||
80 | * @param Coordinates|null $coordinates |
||
81 | * @param Bounds|null $bounds |
||
82 | * @param string|null $streetNumber |
||
83 | * @param string|null $streetName |
||
84 | * @param string|null $postalCode |
||
85 | * @param string|null $locality |
||
86 | * @param string|null $subLocality |
||
87 | * @param Country|null $country |
||
88 | * @param string|null $timezone |
||
89 | */ |
||
90 | 35 | public function __construct( |
|
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getProvidedBy(): string |
||
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 20 | public function getCoordinates() |
|
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | 12 | public function getBounds() |
|
139 | |||
140 | /** |
||
141 | * {@inheritdoc} |
||
142 | */ |
||
143 | 15 | public function getStreetNumber() |
|
147 | |||
148 | /** |
||
149 | * {@inheritdoc} |
||
150 | */ |
||
151 | 15 | public function getStreetName() |
|
155 | |||
156 | /** |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | 15 | public function getLocality() |
|
163 | |||
164 | /** |
||
165 | * {@inheritdoc} |
||
166 | */ |
||
167 | 15 | public function getPostalCode() |
|
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | 15 | public function getSubLocality() |
|
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | 15 | public function getAdminLevels(): AdminLevelCollection |
|
187 | |||
188 | /** |
||
189 | * {@inheritdoc} |
||
190 | */ |
||
191 | 31 | public function getCountry() |
|
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | 15 | public function getTimezone() |
|
203 | |||
204 | /** |
||
205 | * Create an Address with an array. Useful for testing. |
||
206 | * |
||
207 | * @param array $data |
||
208 | * |
||
209 | * @return static |
||
210 | */ |
||
211 | 34 | public static function createFromArray(array $data) |
|
279 | |||
280 | /** |
||
281 | * @param float $latitude |
||
282 | * @param float $longitude |
||
283 | * |
||
284 | * @return Coordinates|null |
||
285 | */ |
||
286 | 34 | private static function createCoordinates($latitude, $longitude) |
|
294 | |||
295 | /** |
||
296 | * @param float $south |
||
297 | * @param float $west |
||
298 | * @param float $north |
||
299 | * |
||
300 | * @return Bounds|null |
||
301 | */ |
||
302 | 34 | private static function createBounds($south, $west, $north, $east) |
|
310 | |||
311 | /** |
||
312 | * {@inheritdoc} |
||
313 | */ |
||
314 | 16 | public function toArray(): array |
|
362 | } |
||
363 |