Skip to content

Commit 90c3b60

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 853e954 commit 90c3b60

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

GeoPlugin.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
use Geocoder\Collection;
1616
use Geocoder\Exception\InvalidServerResponse;
1717
use Geocoder\Exception\UnsupportedOperation;
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

2525
/**
2626
* @author Andrea Cristaudo <[email protected]>
@@ -30,11 +30,8 @@ final class GeoPlugin extends AbstractHttpProvider implements Provider
3030
/**
3131
* @var string
3232
*/
33-
const GEOCODE_ENDPOINT_URL = 'http://www.geoplugin.net/json.gp?ip=%s';
33+
public const GEOCODE_ENDPOINT_URL = 'http://www.geoplugin.net/json.gp?ip=%s';
3434

35-
/**
36-
* {@inheritdoc}
37-
*/
3835
public function geocodeQuery(GeocodeQuery $query): Collection
3936
{
4037
$address = $query->getText();
@@ -51,27 +48,16 @@ public function geocodeQuery(GeocodeQuery $query): Collection
5148
return $this->executeQuery($url);
5249
}
5350

54-
/**
55-
* {@inheritdoc}
56-
*/
5751
public function reverseQuery(ReverseQuery $query): Collection
5852
{
5953
throw new UnsupportedOperation('The GeoPlugin provider is not able to do reverse geocoding.');
6054
}
6155

62-
/**
63-
* {@inheritdoc}
64-
*/
6556
public function getName(): string
6657
{
6758
return 'geo_plugin';
6859
}
6960

70-
/**
71-
* @param string $url
72-
*
73-
* @return AddressCollection
74-
*/
7561
private function executeQuery(string $url): AddressCollection
7662
{
7763
$content = $this->getUrlContents($url);

Tests/GeoPluginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
namespace Geocoder\Provider\GeoPlugin\Tests;
1414

1515
use Geocoder\IntegrationTest\BaseTestCase;
16+
use Geocoder\Provider\GeoPlugin\GeoPlugin;
1617
use Geocoder\Query\GeocodeQuery;
1718
use Geocoder\Query\ReverseQuery;
18-
use Geocoder\Provider\GeoPlugin\GeoPlugin;
1919

2020
class GeoPluginTest extends BaseTestCase
2121
{

0 commit comments

Comments
 (0)