Skip to content

Commit 72555af

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 b4c17d3 commit 72555af

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Pelias.php

Lines changed: 5 additions & 5 deletions
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
class Pelias extends AbstractHttpProvider implements Provider
2828
{
@@ -37,11 +37,11 @@ class Pelias extends AbstractHttpProvider implements Provider
3737
private $version;
3838

3939
/**
40-
* @param HttpClient $client an HTTP adapter
41-
* @param string $root url of Pelias API
42-
* @param int $version version of Pelias API
40+
* @param ClientInterface $client an HTTP adapter
41+
* @param string $root url of Pelias API
42+
* @param int $version version of Pelias API
4343
*/
44-
public function __construct(HttpClient $client, string $root, int $version = 1)
44+
public function __construct(ClientInterface $client, string $root, int $version = 1)
4545
{
4646
$this->root = sprintf('%s/v%d', rtrim($root, '/'), $version);
4747
$this->version = $version;

Tests/IntegrationTest.php

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

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

1919
/**
2020
* @author Tobias Nyholm <[email protected]>
@@ -32,7 +32,7 @@ class IntegrationTest extends ProviderIntegrationTest
3232

3333
protected $testIpv6 = false;
3434

35-
protected function createProvider(HttpClient $httpClient)
35+
protected function createProvider(ClientInterface $httpClient)
3636
{
3737
return new Pelias($httpClient, 'http://localhost/');
3838
}

0 commit comments

Comments
 (0)