Get tests passing
This commit is contained in:
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||
namespace Pcm\GeocodeBundle\Service;
|
||||
|
||||
use Exception;
|
||||
use Pcm\GeocodeBundle\Data\LatLon;
|
||||
use Pcm\GeocodeBundle\Entity\GeocodeData;
|
||||
use Pcm\GeocodeBundle\Model\LatLonModel;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
|
||||
@@ -17,12 +17,12 @@ class Geocoder
|
||||
public function __construct(private HttpClientInterface $client) {}
|
||||
|
||||
/**
|
||||
* Returns a LatLon object
|
||||
* Returns a LatLonModel object
|
||||
*
|
||||
* @param string $postcode
|
||||
* @return GeocodeData
|
||||
*/
|
||||
public function geocodePostcode(string $postcode): LatLon
|
||||
public function geocodePostcode(string $postcode): LatLonModel
|
||||
{
|
||||
$client = $this->setClientHeaders();
|
||||
$response = $this->makeApiRequest($client, $postcode);
|
||||
@@ -59,8 +59,8 @@ class Geocoder
|
||||
throw new Exception("No data was received from API response! Were the arguments valid?");
|
||||
}
|
||||
|
||||
private function createGeocodeDataObject(array $data): LatLon
|
||||
private function createGeocodeDataObject(array $data): LatLonModel
|
||||
{
|
||||
return new LatLon((float) $data[0]['lat'], (float) $data[0]['lon']);
|
||||
return new LatLonModel((float) $data[0]['lat'], (float) $data[0]['lon']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user