Skip to content

Commit

Permalink
Add PHP Coding Standards Fixer in CI (#1196)
Browse files Browse the repository at this point in the history
* Update composer.json

* Update .gitignore

* Update php.yml

* Apply PHPCSFixer fixes

* Switch to php-cs-fixer/shim

* Create .php-cs-fixer.dist.php
  • Loading branch information
jbelien committed Jul 21, 2023
1 parent 802ea38 commit a7cd6f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
31 changes: 5 additions & 26 deletions ArcGISOnline.php
Expand Up @@ -17,12 +17,12 @@
use Geocoder\Exception\InvalidCredentials;
use Geocoder\Exception\InvalidServerResponse;
use Geocoder\Exception\UnsupportedOperation;
use Geocoder\Http\Provider\AbstractHttpProvider;
use Geocoder\Model\Address;
use Geocoder\Model\AddressCollection;
use Geocoder\Provider\Provider;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Geocoder\Http\Provider\AbstractHttpProvider;
use Geocoder\Provider\Provider;
use Psr\Http\Client\ClientInterface;

/**
Expand All @@ -33,17 +33,17 @@ final class ArcGISOnline extends AbstractHttpProvider implements Provider
/**
* @var string
*/
const ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine=%s';
public const ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine=%s';

/**
* @var string
*/
const TOKEN_ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses?token=%s&addresses=%s';
public const TOKEN_ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses?token=%s&addresses=%s';

/**
* @var string
*/
const REVERSE_ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=%F,%F';
public const REVERSE_ENDPOINT_URL = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=%F,%F';

/**
* @var string
Expand Down Expand Up @@ -92,9 +92,6 @@ public function __construct(ClientInterface $client, string $sourceCountry = nul
$this->token = $token;
}

/**
* {@inheritdoc}
*/
public function geocodeQuery(GeocodeQuery $query): Collection
{
$address = $query->getText();
Expand Down Expand Up @@ -155,9 +152,6 @@ public function geocodeQuery(GeocodeQuery $query): Collection
return new AddressCollection($results);
}

/**
* {@inheritdoc}
*/
public function reverseQuery(ReverseQuery $query): Collection
{
$coordinates = $query->getCoordinates();
Expand Down Expand Up @@ -195,20 +189,11 @@ public function reverseQuery(ReverseQuery $query): Collection
]);
}

/**
* {@inheritdoc}
*/
public function getName(): string
{
return 'arcgis_online';
}

/**
* @param string $query
* @param int $limit
*
* @return string
*/
private function buildQuery(string $query, int $limit): string
{
if (null !== $this->sourceCountry) {
Expand All @@ -221,12 +206,6 @@ private function buildQuery(string $query, int $limit): string
return sprintf('%s&f=%s', $query, 'json');
}

/**
* @param string $url
* @param int $limit
*
* @return \stdClass
*/
private function executeQuery(string $url, int $limit): \stdClass
{
$url = $this->buildQuery($url, $limit);
Expand Down
2 changes: 1 addition & 1 deletion Tests/ArcGISOnlineTest.php
Expand Up @@ -15,9 +15,9 @@
use Geocoder\Collection;
use Geocoder\IntegrationTest\BaseTestCase;
use Geocoder\Location;
use Geocoder\Provider\ArcGISOnline\ArcGISOnline;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Geocoder\Provider\ArcGISOnline\ArcGISOnline;

class ArcGISOnlineTest extends BaseTestCase
{
Expand Down

0 comments on commit a7cd6f8

Please sign in to comment.