Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5779a54

Browse files
authoredJul 30, 2022
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
1 parent 604d96a commit 5779a54

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎IpInfoDb.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Geocoder\Query\ReverseQuery;
2323
use Geocoder\Http\Provider\AbstractHttpProvider;
2424
use Geocoder\Provider\Provider;
25-
use Http\Client\HttpClient;
25+
use Psr\Http\Client\ClientInterface;
2626

2727
/**
2828
* @author William Durand <william.durand1@gmail.com>
@@ -50,13 +50,13 @@ final class IpInfoDb extends AbstractHttpProvider implements Provider
5050
private $endpointUrl;
5151

5252
/**
53-
* @param HttpClient $client an HTTP adapter
54-
* @param string $apiKey an API key
55-
* @param string $precision The endpoint precision. Either "city" or "country" (faster)
53+
* @param ClientInterface $client an HTTP adapter
54+
* @param string $apiKey an API key
55+
* @param string $precision The endpoint precision. Either "city" or "country" (faster)
5656
*
5757
* @throws \Geocoder\Exception\InvalidArgument
5858
*/
59-
public function __construct(HttpClient $client, string $apiKey, string $precision = 'city')
59+
public function __construct(ClientInterface $client, string $apiKey, string $precision = 'city')
6060
{
6161
parent::__construct($client);
6262

‎Tests/IntegrationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use Geocoder\IntegrationTest\ProviderIntegrationTest;
1616
use Geocoder\Provider\IpInfoDb\IpInfoDb;
17-
use Http\Client\HttpClient;
17+
use Psr\Http\Client\ClientInterface;
1818

1919
/**
2020
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
@@ -27,7 +27,7 @@ class IntegrationTest extends ProviderIntegrationTest
2727

2828
protected $testIpv6 = false;
2929

30-
protected function createProvider(HttpClient $httpClient)
30+
protected function createProvider(ClientInterface $httpClient)
3131
{
3232
return new IpInfoDb($httpClient, $this->getApiKey());
3333
}

0 commit comments

Comments
 (0)
Please sign in to comment.