Skip to content

Commit b1fc433

Browse files
authoredJul 26, 2018
Merge pull request Rentberry#10 from svityashchuk/master
Usage postal_town as alternative of locality to set city field
2 parents fd4276e + 7c286e3 commit b1fc433

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎src/PlaceSimpleFactory.php

+14
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ protected function setRoute(array $component, Place $place): Place
149149
* @return Place
150150
*/
151151
protected function setLocality(array $component, Place $place): Place
152+
{
153+
$place->setCity($component['long_name']);
154+
155+
return $place;
156+
}
157+
158+
/**
159+
* Postal town as alternative data if locality isn't present
160+
*
161+
* @param mixed[] $component
162+
* @param Place $place
163+
* @return Place
164+
*/
165+
protected function setPostalTown(array $component, Place $place): Place
152166
{
153167
if ($place->getCity() === null) {
154168
$place->setCity($component['long_name']);

0 commit comments

Comments
 (0)
Please sign in to comment.