Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #10 from svityashchuk/master
Browse files Browse the repository at this point in the history
Usage postal_town as alternative of locality to set city field
  • Loading branch information
Bukashk0zzz authored Jul 26, 2018
2 parents fd4276e + 7c286e3 commit b1fc433
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/PlaceSimpleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ protected function setRoute(array $component, Place $place): Place
* @return Place
*/
protected function setLocality(array $component, Place $place): Place
{
$place->setCity($component['long_name']);

return $place;
}

/**
* Postal town as alternative data if locality isn't present
*
* @param mixed[] $component
* @param Place $place
* @return Place
*/
protected function setPostalTown(array $component, Place $place): Place
{
if ($place->getCity() === null) {
$place->setCity($component['long_name']);
Expand Down

0 comments on commit b1fc433

Please sign in to comment.