Skip to content

Commit 3a78694

Browse files
authored
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 7b7020b commit 3a78694

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Geonames.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Geocoder\Query\ReverseQuery;
2626
use Geocoder\Http\Provider\AbstractHttpProvider;
2727
use Geocoder\Provider\Provider;
28-
use Http\Client\HttpClient;
28+
use Psr\Http\Client\ClientInterface;
2929

3030
/**
3131
* @author Giovanni Pirrotta <giovanni.pirrotta@gmail.com>
@@ -53,10 +53,10 @@ final class Geonames extends AbstractHttpProvider implements Provider
5353
private $username;
5454

5555
/**
56-
* @param HttpClient $client An HTTP adapter
57-
* @param string $username Username login (Free registration at http://www.geonames.org/login)
56+
* @param ClientInterface $client An HTTP adapter
57+
* @param string $username Username login (Free registration at http://www.geonames.org/login)
5858
*/
59-
public function __construct(HttpClient $client, string $username)
59+
public function __construct(ClientInterface $client, string $username)
6060
{
6161
if (empty($username)) {
6262
throw new InvalidCredentials('No username provided.');

Tests/IntegrationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use Geocoder\IntegrationTest\ProviderIntegrationTest;
1414
use Geocoder\Provider\Geonames\Geonames;
15-
use Http\Client\HttpClient;
15+
use Psr\Http\Client\ClientInterface;
1616

1717
/**
1818
* @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 Geonames($httpClient, $this->getApiKey());
3333
}

0 commit comments

Comments
 (0)