Skip to content

Commit 3fc7e58

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 1d437fa commit 3fc7e58

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

OpenRouteService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Geocoder\Query\ReverseQuery;
1919
use Geocoder\Provider\Pelias\Pelias;
2020
use Geocoder\Provider\Provider;
21-
use Http\Client\HttpClient;
21+
use Psr\Http\Client\ClientInterface;
2222

2323
final class OpenRouteService extends Pelias implements Provider
2424
{
@@ -32,10 +32,10 @@ final class OpenRouteService extends Pelias implements Provider
3232
private $apiKey;
3333

3434
/**
35-
* @param HttpClient $client an HTTP adapter
36-
* @param string $apiKey an API key
35+
* @param ClientInterface $client an HTTP adapter
36+
* @param string $apiKey an API key
3737
*/
38-
public function __construct(HttpClient $client, string $apiKey)
38+
public function __construct(ClientInterface $client, string $apiKey)
3939
{
4040
if (empty($apiKey)) {
4141
throw new InvalidCredentials('No API key provided.');

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\OpenRouteService\OpenRouteService;
17-
use Http\Client\HttpClient;
17+
use Psr\Http\Client\ClientInterface;
1818

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

3030
protected $testIpv6 = false;
3131

32-
protected function createProvider(HttpClient $httpClient)
32+
protected function createProvider(ClientInterface $httpClient)
3333
{
3434
return new OpenRouteService($httpClient, $this->getApiKey());
3535
}

0 commit comments

Comments
 (0)