Get tests passing

This commit is contained in:
Brabli
2022-07-21 14:46:51 +01:00
parent 9cca12b334
commit e87294e96f
2 changed files with 8 additions and 8 deletions

View File

@@ -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']);
}
}