Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to PSR-18 #7

Merged
merged 2 commits into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Addok.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Geocoder\Provider\Provider;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Http\Client\HttpClient;
use Psr\Http\Client\ClientInterface;

/**
* @author Jonathan Beliën <jbe@geo6.be>
Expand All @@ -40,21 +40,21 @@ final class Addok extends AbstractHttpProvider implements Provider
private $rootUrl;

/**
* @param HttpClient $client
* @param string|null $locale
* @param ClientInterface $client
* @param string|null $locale
*
* @return Addok
*/
public static function withBANServer(HttpClient $client)
public static function withBANServer(ClientInterface $client)
{
return new self($client, 'https://api-adresse.data.gouv.fr');
}

/**
* @param HttpClient $client an HTTP adapter
* @param string $rootUrl Root URL of the addok server
* @param ClientInterface $client an HTTP adapter
* @param string $rootUrl Root URL of the addok server
*/
public function __construct(HttpClient $client, $rootUrl)
public function __construct(ClientInterface $client, $rootUrl)
{
parent::__construct($client);

Expand Down
4 changes: 2 additions & 2 deletions Tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use Geocoder\IntegrationTest\ProviderIntegrationTest;
use Geocoder\Provider\Addok\Addok;
use Http\Client\HttpClient;
use Psr\Http\Client\ClientInterface;

class IntegrationTest extends ProviderIntegrationTest
{
Expand All @@ -30,7 +30,7 @@ class IntegrationTest extends ProviderIntegrationTest
'testReverseQueryWithNoResults' => 'Addok returns "debug" information for reverse geocoding on coordinates 0, 0. See https://github.com/addok/addok/issues/505',
];

protected function createProvider(HttpClient $httpClient)
protected function createProvider(ClientInterface $httpClient)
{
return Addok::withBANServer($httpClient);
}
Expand Down