diff --git a/src/Geocoder.php b/src/Geocoder.php index dcb81a7..618cb3d 100644 --- a/src/Geocoder.php +++ b/src/Geocoder.php @@ -115,19 +115,19 @@ public function getAllAddressesForCoordinates(float $lat, float $lng): array $payload = $this->getRequestPayload([ 'latlng' => "$lat,$lng", ]); - + $response = $this->client->request('GET', $this->endpoint, $payload); - + if ($response->getStatusCode() !== 200) { throw CouldNotGeocode::couldNotConnect(); } - + $reverseGeocodingResponse = json_decode($response->getBody()); - + if (! empty($reverseGeocodingResponse->error_message)) { throw CouldNotGeocode::serviceReturnedError($reverseGeocodingResponse->error_message); } - + if (! count($reverseGeocodingResponse->results)) { return $this->emptyResponse(); }