Skip to content

Commit 5838e76

Browse files
authored
Add PHP Coding Standards Fixer in CI (#1196)
* Update composer.json * Update .gitignore * Update php.yml * Apply PHPCSFixer fixes * Switch to php-cs-fixer/shim * Create .php-cs-fixer.dist.php
1 parent 3525f29 commit 5838e76

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

IP2Location.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212

1313
namespace Geocoder\Provider\IP2Location;
1414

15+
use Geocoder\Collection;
1516
use Geocoder\Exception\InvalidCredentials;
1617
use Geocoder\Exception\UnsupportedOperation;
17-
use Geocoder\Collection;
18+
use Geocoder\Http\Provider\AbstractHttpProvider;
1819
use Geocoder\Model\Address;
1920
use Geocoder\Model\AddressCollection;
21+
use Geocoder\Provider\Provider;
2022
use Geocoder\Query\GeocodeQuery;
2123
use Geocoder\Query\ReverseQuery;
22-
use Geocoder\Http\Provider\AbstractHttpProvider;
23-
use Geocoder\Provider\Provider;
2424
use Psr\Http\Client\ClientInterface;
2525

2626
/**
@@ -31,7 +31,7 @@ final class IP2Location extends AbstractHttpProvider implements Provider
3131
/**
3232
* @var string
3333
*/
34-
const ENDPOINT_URL = 'https://api.ip2location.com/v2/?key=%s&ip=%s&format=json&package=WS9';
34+
public const ENDPOINT_URL = 'https://api.ip2location.com/v2/?key=%s&ip=%s&format=json&package=WS9';
3535

3636
/**
3737
* @var string
@@ -55,9 +55,6 @@ public function __construct(ClientInterface $client, string $apiKey)
5555
$this->endpointUrl = self::ENDPOINT_URL;
5656
}
5757

58-
/**
59-
* {@inheritdoc}
60-
*/
6158
public function geocodeQuery(GeocodeQuery $query): Collection
6259
{
6360
$address = $query->getText();
@@ -79,25 +76,16 @@ public function geocodeQuery(GeocodeQuery $query): Collection
7976
return $this->executeQuery($url);
8077
}
8178

82-
/**
83-
* {@inheritdoc}
84-
*/
8579
public function reverseQuery(ReverseQuery $query): Collection
8680
{
8781
throw new UnsupportedOperation('The IP2Location provider is not able to do reverse geocoding.');
8882
}
8983

90-
/**
91-
* {@inheritdoc}
92-
*/
9384
public function getName(): string
9485
{
9586
return 'ip2location';
9687
}
9788

98-
/**
99-
* @param string $url
100-
*/
10189
private function executeQuery(string $url): AddressCollection
10290
{
10391
$content = $this->getUrlContents($url);

Tests/IP2LocationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
use Geocoder\IntegrationTest\BaseTestCase;
1616
use Geocoder\Location;
17+
use Geocoder\Provider\IP2Location\IP2Location;
1718
use Geocoder\Query\GeocodeQuery;
1819
use Geocoder\Query\ReverseQuery;
19-
use Geocoder\Provider\IP2Location\IP2Location;
2020

2121
class IP2LocationTest extends BaseTestCase
2222
{

0 commit comments

Comments
 (0)