From 4a9f0da6cbf4c650a0afd7d006395f34ecd41602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sun, 31 Jul 2022 11:15:24 +0200 Subject: [PATCH 1/2] Migrate to PSR-18 --- Addok.php | 10 +++++----- Tests/IntegrationTest.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Addok.php b/Addok.php index 61f51f7..a6908b7 100644 --- a/Addok.php +++ b/Addok.php @@ -22,7 +22,7 @@ use Geocoder\Provider\Provider; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; /** * @author Jonathan Beliƫn @@ -40,21 +40,21 @@ final class Addok extends AbstractHttpProvider implements Provider private $rootUrl; /** - * @param HttpClient $client + * @param ClientInterface $client * @param string|null $locale * * @return Addok */ - public static function withBANServer(HttpClient $client) + public static function withBANServer(ClientInterface $client) { return new self($client, 'https://api-adresse.data.gouv.fr'); } /** - * @param HttpClient $client an HTTP adapter + * @param ClientInterface $client an HTTP adapter * @param string $rootUrl Root URL of the addok server */ - public function __construct(HttpClient $client, $rootUrl) + public function __construct(ClientInterface $client, $rootUrl) { parent::__construct($client); diff --git a/Tests/IntegrationTest.php b/Tests/IntegrationTest.php index b5d8731..8b0c3da 100644 --- a/Tests/IntegrationTest.php +++ b/Tests/IntegrationTest.php @@ -12,7 +12,7 @@ use Geocoder\IntegrationTest\ProviderIntegrationTest; use Geocoder\Provider\Addok\Addok; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; class IntegrationTest extends ProviderIntegrationTest { @@ -30,7 +30,7 @@ class IntegrationTest extends ProviderIntegrationTest 'testReverseQueryWithNoResults' => 'Addok returns "debug" information for reverse geocoding on coordinates 0, 0. See https://github.com/addok/addok/issues/505', ]; - protected function createProvider(HttpClient $httpClient) + protected function createProvider(ClientInterface $httpClient) { return Addok::withBANServer($httpClient); } From 0eb44a33b55a92433857848210abe2ee716b7775 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Sun, 31 Jul 2022 09:15:32 +0000 Subject: [PATCH 2/2] Apply fixes from StyleCI --- Addok.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Addok.php b/Addok.php index a6908b7..24d8e08 100644 --- a/Addok.php +++ b/Addok.php @@ -40,8 +40,8 @@ final class Addok extends AbstractHttpProvider implements Provider private $rootUrl; /** - * @param ClientInterface $client - * @param string|null $locale + * @param ClientInterface $client + * @param string|null $locale * * @return Addok */ @@ -52,7 +52,7 @@ public static function withBANServer(ClientInterface $client) /** * @param ClientInterface $client an HTTP adapter - * @param string $rootUrl Root URL of the addok server + * @param string $rootUrl Root URL of the addok server */ public function __construct(ClientInterface $client, $rootUrl) {