From eeda249a1eb3069e3c26007b980a1bff30d4f855 Mon Sep 17 00:00:00 2001 From: Jasper Zonneveld Date: Sat, 30 Jul 2022 12:48:32 +0200 Subject: [PATCH] Expect a PSR-18 client instead of a PHP-HTTP client (#1110) * Expect a PSR-18 client instead of a PHP-HTTP client * Update integration tests --- LocationIQ.php | 8 ++++---- Tests/IntegrationTest.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LocationIQ.php b/LocationIQ.php index 93ab379..24f6ded 100644 --- a/LocationIQ.php +++ b/LocationIQ.php @@ -23,7 +23,7 @@ use Geocoder\Query\ReverseQuery; use Geocoder\Http\Provider\AbstractHttpProvider; use Geocoder\Provider\Provider; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; /** * @author Srihari Thalla @@ -54,10 +54,10 @@ final class LocationIQ extends AbstractHttpProvider implements Provider private $apiKey; /** - * @param HttpClient $client an HTTP adapter - * @param string $apiKey an API key + * @param ClientInterface $client an HTTP adapter + * @param string $apiKey an API key */ - public function __construct(HttpClient $client, string $apiKey, string $region = null) + public function __construct(ClientInterface $client, string $apiKey, string $region = null) { if (empty($apiKey)) { throw new InvalidCredentials('No API key provided.'); diff --git a/Tests/IntegrationTest.php b/Tests/IntegrationTest.php index 528d079..fe45fc2 100644 --- a/Tests/IntegrationTest.php +++ b/Tests/IntegrationTest.php @@ -12,7 +12,7 @@ use Geocoder\IntegrationTest\ProviderIntegrationTest; use Geocoder\Provider\LocationIQ\LocationIQ; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; /** * @author Srihari Thalla @@ -27,7 +27,7 @@ class IntegrationTest extends ProviderIntegrationTest protected $testIpv6 = false; - protected function createProvider(HttpClient $httpClient) + protected function createProvider(ClientInterface $httpClient) { return new LocationIQ($httpClient, $this->getApiKey()); }