From a7cd6f8e9f9618ff99a40e5ecbf022cfbed501ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Fri, 21 Jul 2023 11:32:47 +0200 Subject: [PATCH] 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 --- ArcGISOnline.php | 31 +++++-------------------------- Tests/ArcGISOnlineTest.php | 2 +- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/ArcGISOnline.php b/ArcGISOnline.php index 6598fb0..f292ca4 100644 --- a/ArcGISOnline.php +++ b/ArcGISOnline.php @@ -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; /** @@ -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 @@ -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(); @@ -155,9 +152,6 @@ public function geocodeQuery(GeocodeQuery $query): Collection return new AddressCollection($results); } - /** - * {@inheritdoc} - */ public function reverseQuery(ReverseQuery $query): Collection { $coordinates = $query->getCoordinates(); @@ -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) { @@ -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); diff --git a/Tests/ArcGISOnlineTest.php b/Tests/ArcGISOnlineTest.php index 62f85cd..9cd7d64 100644 --- a/Tests/ArcGISOnlineTest.php +++ b/Tests/ArcGISOnlineTest.php @@ -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 {