Skip to content

Commit 16481ce

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 29318e0 commit 16481ce

File tree

2 files changed

+21
-36
lines changed

2 files changed

+21
-36
lines changed

MapQuest.php

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
use Geocoder\Model\AdminLevel;
2626
use Geocoder\Model\Bounds;
2727
use Geocoder\Model\Country;
28+
use Geocoder\Provider\Provider;
2829
use Geocoder\Query\GeocodeQuery;
2930
use Geocoder\Query\ReverseQuery;
30-
use Geocoder\Provider\Provider;
3131
use Psr\Http\Client\ClientInterface;
3232
use Psr\Http\Message\ResponseInterface;
3333

@@ -36,50 +36,50 @@
3636
*/
3737
final class MapQuest extends AbstractHttpProvider implements Provider
3838
{
39-
const DATA_KEY_ADDRESS = 'address';
39+
public const DATA_KEY_ADDRESS = 'address';
4040

41-
const KEY_API_KEY = 'key';
41+
public const KEY_API_KEY = 'key';
4242

43-
const KEY_LOCATION = 'location';
43+
public const KEY_LOCATION = 'location';
4444

45-
const KEY_OUT_FORMAT = 'outFormat';
45+
public const KEY_OUT_FORMAT = 'outFormat';
4646

47-
const KEY_MAX_RESULTS = 'maxResults';
47+
public const KEY_MAX_RESULTS = 'maxResults';
4848

49-
const KEY_THUMB_MAPS = 'thumbMaps';
49+
public const KEY_THUMB_MAPS = 'thumbMaps';
5050

51-
const KEY_INTL_MODE = 'intlMode';
51+
public const KEY_INTL_MODE = 'intlMode';
5252

53-
const KEY_BOUNDING_BOX = 'boundingBox';
53+
public const KEY_BOUNDING_BOX = 'boundingBox';
5454

55-
const KEY_LAT = 'lat';
55+
public const KEY_LAT = 'lat';
5656

57-
const KEY_LNG = 'lng';
57+
public const KEY_LNG = 'lng';
5858

59-
const MODE_5BOX = '5BOX';
59+
public const MODE_5BOX = '5BOX';
6060

61-
const OPEN_BASE_URL = 'https://open.mapquestapi.com/geocoding/v1/';
61+
public const OPEN_BASE_URL = 'https://open.mapquestapi.com/geocoding/v1/';
6262

63-
const LICENSED_BASE_URL = 'https://www.mapquestapi.com/geocoding/v1/';
63+
public const LICENSED_BASE_URL = 'https://www.mapquestapi.com/geocoding/v1/';
6464

65-
const GEOCODE_ENDPOINT = 'address';
65+
public const GEOCODE_ENDPOINT = 'address';
6666

67-
const DEFAULT_GEOCODE_PARAMS = [
67+
public const DEFAULT_GEOCODE_PARAMS = [
6868
self::KEY_LOCATION => '',
6969
self::KEY_OUT_FORMAT => 'json',
7070
self::KEY_API_KEY => '',
7171
];
7272

73-
const DEFAULT_GEOCODE_OPTIONS = [
73+
public const DEFAULT_GEOCODE_OPTIONS = [
7474
self::KEY_MAX_RESULTS => 3,
7575
self::KEY_THUMB_MAPS => false,
7676
];
7777

78-
const REVERSE_ENDPOINT = 'reverse';
78+
public const REVERSE_ENDPOINT = 'reverse';
7979

80-
const ADMIN_LEVEL_STATE = 1;
80+
public const ADMIN_LEVEL_STATE = 1;
8181

82-
const ADMIN_LEVEL_COUNTY = 2;
82+
public const ADMIN_LEVEL_COUNTY = 2;
8383

8484
/**
8585
* MapQuest offers two geocoding endpoints one commercial (true) and one open (false)
@@ -117,9 +117,6 @@ public function __construct(ClientInterface $client, string $apiKey, bool $licen
117117
parent::__construct($client);
118118
}
119119

120-
/**
121-
* {@inheritdoc}
122-
*/
123120
public function geocodeQuery(GeocodeQuery $query): Collection
124121
{
125122
$params = static::DEFAULT_GEOCODE_PARAMS;
@@ -167,9 +164,6 @@ public function geocodeQuery(GeocodeQuery $query): Collection
167164
}
168165
}
169166

170-
/**
171-
* {@inheritdoc}
172-
*/
173167
public function reverseQuery(ReverseQuery $query): Collection
174168
{
175169
$coordinates = $query->getCoordinates();
@@ -185,9 +179,6 @@ public function reverseQuery(ReverseQuery $query): Collection
185179
return $this->executeGetQuery(static::REVERSE_ENDPOINT, $params);
186180
}
187181

188-
/**
189-
* {@inheritdoc}
190-
*/
191182
public function getName(): string
192183
{
193184
return 'map_quest';
@@ -252,12 +243,6 @@ private function executePostQuery(string $endpoint, array $params)
252243
return $this->parseResponseContent($content);
253244
}
254245

255-
/**
256-
* @param string $endpoint
257-
* @param array $params
258-
*
259-
* @return AddressCollection
260-
*/
261246
private function executeGetQuery(string $endpoint, array $params): AddressCollection
262247
{
263248
$baseUrl = $this->getUrl($endpoint);

Tests/MapQuestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use Geocoder\Model\AddressBuilder;
1919
use Geocoder\Model\AdminLevel;
2020
use Geocoder\Model\Bounds;
21+
use Geocoder\Provider\MapQuest\MapQuest;
2122
use Geocoder\Query\GeocodeQuery;
2223
use Geocoder\Query\ReverseQuery;
23-
use Geocoder\Provider\MapQuest\MapQuest;
2424

2525
/**
2626
* @author William Durand <[email protected]>

0 commit comments

Comments
 (0)