Skip to content

Commit

Permalink
[Google Maps] Added missing nullable return type (#1065)
Browse files Browse the repository at this point in the history
Sometimes Google Maps does not return a Plus Code.
PoC:
{"query":"[object] (Geocoder\\Query\\GeocodeQuery: GeocodeQuery: {\"text\":\"Port of Ijmuiden, North Holland, Netherlands, Port Ijmuiden Port\",\"bounds\":\"null\",\"locale\":null,\"limit\":5,\"data\":{\"mode\":\"search\",\"fields\":\"formatted_address, geometry, icon, name, place_id, plus_code, types\"}})"} 

The first 2 results have a PlusCode but the rest do not, which generates an exception.
  • Loading branch information
jackff87 authored Jul 4, 2020
1 parent 1f88358 commit 94bb648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Provider/GoogleMapsPlaces/Model/GooglePlace.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function withIcon(string $icon = null)
/**
* @return PlusCode|null
*/
public function getPlusCode(): PlusCode
public function getPlusCode(): ?PlusCode
{
return $this->plusCode;
}
Expand Down

0 comments on commit 94bb648

Please sign in to comment.