Update docblocks
This commit is contained in:
@@ -10,6 +10,9 @@ use Pcm\GeocodeBundle\Model\GeoCoordinates;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Find the geo-coordinates of a postcode
|
||||
*/
|
||||
final class Geocoder
|
||||
{
|
||||
private const string API_URL = "https://nominatim.openstreetmap.org/search";
|
||||
@@ -17,12 +20,16 @@ final class Geocoder
|
||||
public function __construct(private HttpClientInterface $client) {}
|
||||
|
||||
/**
|
||||
* Convert a postcode into latitude and longitude. Returns null if conversion failed.
|
||||
* Find and return the geo-coordinates of a postcode
|
||||
*
|
||||
* @param string $postcode
|
||||
* @return null|GeoCoordinates
|
||||
*
|
||||
* @return GeoCoordinates
|
||||
*
|
||||
* @throws NoResultsFoundException when no results were found for the provided postcode
|
||||
* @throws ApiErrorException when the API response contains an error
|
||||
*/
|
||||
public function geocodePostcode(string $postcode): ?GeoCoordinates
|
||||
public function geocodePostcode(string $postcode): GeoCoordinates
|
||||
{
|
||||
$client = $this->createClient();
|
||||
$response = $this->makeApiRequest($client, $postcode);
|
||||
|
||||
Reference in New Issue
Block a user