Compare commits

..

No commits in common. 'master' and 'v0.0.7' have entirely different histories.

@ -16,12 +16,9 @@ interface GeocodingServiceContract
public function getCoordinatesForAddress(string $address): GeocodingResponseData;
/**
* Retrieves the address for the given coordinates.
*
* @param float $latitude The latitude of the coordinates.
* @param float $longitude The longitude of the coordinates.
*
* @return GeocodingResponseData The address information for the given coordinates.
* @param float $latitude
* @param float $longitude
* @return array
*/
public function getAddressForCoordinates(float $latitude, float $longitude): GeocodingResponseData;
public function getAddressForCoordinates(float $latitude, float $longitude): array;
}

@ -56,20 +56,10 @@ class GeocodingService implements GeocodingServiceContract
* @param float $latitude The latitude of the coordinates.
* @param float $longitude The longitude of the coordinates.
*
* @return GeocodingResponseData The address information for the given coordinates.
* @return array The address information for the given coordinates.
*/
public function getAddressForCoordinates(float $latitude, float $longitude): GeocodingResponseData
public function getAddressForCoordinates(float $latitude, float $longitude): array
{
$response = $this->geocoder->getAddressForCoordinates($latitude, $longitude);
$viewport = array_key_exists('viewport', $response)
? get_object_vars($response['viewport'])
: [];
$response['viewport'] = $viewport;
return GeocodingResponseData::from(
$response
);
return $this->geocoder->getAddressForCoordinates($latitude, $longitude);
}
}
Loading…
Cancel
Save