Skip to content

Commit ce6b5f3

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 1921274 commit ce6b5f3

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

IpInfoDb.php

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

1313
namespace Geocoder\Provider\IpInfoDb;
1414

15+
use Geocoder\Collection;
1516
use Geocoder\Exception\InvalidArgument;
1617
use Geocoder\Exception\InvalidCredentials;
1718
use Geocoder\Exception\UnsupportedOperation;
18-
use Geocoder\Collection;
19+
use Geocoder\Http\Provider\AbstractHttpProvider;
1920
use Geocoder\Model\Address;
2021
use Geocoder\Model\AddressCollection;
22+
use Geocoder\Provider\Provider;
2123
use Geocoder\Query\GeocodeQuery;
2224
use Geocoder\Query\ReverseQuery;
23-
use Geocoder\Http\Provider\AbstractHttpProvider;
24-
use Geocoder\Provider\Provider;
2525
use Psr\Http\Client\ClientInterface;
2626

2727
/**
@@ -32,12 +32,12 @@ final class IpInfoDb extends AbstractHttpProvider implements Provider
3232
/**
3333
* @var string
3434
*/
35-
const CITY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-city/?key=%s&format=json&ip=%s';
35+
public const CITY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-city/?key=%s&format=json&ip=%s';
3636

3737
/**
3838
* @var string
3939
*/
40-
const COUNTRY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-country/?key=%s&format=json&ip=%s';
40+
public const COUNTRY_PRECISION_ENDPOINT_URL = 'https://api.ipinfodb.com/v3/ip-country/?key=%s&format=json&ip=%s';
4141

4242
/**
4343
* @var string
@@ -77,9 +77,6 @@ public function __construct(ClientInterface $client, string $apiKey, string $pre
7777
}
7878
}
7979

80-
/**
81-
* {@inheritdoc}
82-
*/
8380
public function geocodeQuery(GeocodeQuery $query): Collection
8481
{
8582
$address = $query->getText();
@@ -105,25 +102,16 @@ public function geocodeQuery(GeocodeQuery $query): Collection
105102
return $this->executeQuery($url);
106103
}
107104

108-
/**
109-
* {@inheritdoc}
110-
*/
111105
public function reverseQuery(ReverseQuery $query): Collection
112106
{
113107
throw new UnsupportedOperation('The IpInfoDb provider is not able to do reverse geocoding.');
114108
}
115109

116-
/**
117-
* {@inheritdoc}
118-
*/
119110
public function getName(): string
120111
{
121112
return 'ip_info_db';
122113
}
123114

124-
/**
125-
* @param string $url
126-
*/
127115
private function executeQuery(string $url): AddressCollection
128116
{
129117
$content = $this->getUrlContents($url);

Tests/IpInfoDbTest.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\IpInfoDb\IpInfoDb;
1718
use Geocoder\Query\GeocodeQuery;
1819
use Geocoder\Query\ReverseQuery;
19-
use Geocoder\Provider\IpInfoDb\IpInfoDb;
2020

2121
class IpInfoDbTest extends BaseTestCase
2222
{

0 commit comments

Comments
 (0)