Skip to content

Commit e86003a

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 8cde7f4 commit e86003a

File tree

3 files changed

+4
-58
lines changed

3 files changed

+4
-58
lines changed

Model/PhotonAddress.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ public function getName()
6262
return $this->name;
6363
}
6464

65-
/**
66-
* @param string|null $name
67-
*
68-
* @return PhotonAddress
69-
*/
7065
public function withName(string $name = null): self
7166
{
7267
$new = clone $this;
@@ -83,11 +78,6 @@ public function getOSMId()
8378
return $this->osmId;
8479
}
8580

86-
/**
87-
* @param int|null $osmId
88-
*
89-
* @return PhotonAddress
90-
*/
9181
public function withOSMId(int $osmId = null): self
9282
{
9383
$new = clone $this;
@@ -104,11 +94,6 @@ public function getOSMType()
10494
return $this->osmType;
10595
}
10696

107-
/**
108-
* @param string|null $osmType
109-
*
110-
* @return PhotonAddress
111-
*/
11297
public function withOSMType(string $osmType = null): self
11398
{
11499
$new = clone $this;
@@ -125,12 +110,6 @@ public function getOSMTag()
125110
return $this->osmTag;
126111
}
127112

128-
/**
129-
* @param string|null $key
130-
* @param string|null $value
131-
*
132-
* @return PhotonAddress
133-
*/
134113
public function withOSMTag(string $key = null, string $value = null): self
135114
{
136115
$new = clone $this;
@@ -155,10 +134,6 @@ public function getState()
155134
return $this->state;
156135
}
157136

158-
/**
159-
* @param string|null $state
160-
* @return PhotonAddress
161-
*/
162137
public function withState(string $state = null): self
163138
{
164139
$new = clone $this;
@@ -175,10 +150,6 @@ public function getCounty()
175150
return $this->county;
176151
}
177152

178-
/**
179-
* @param string|null $county
180-
* @return PhotonAddress
181-
*/
182153
public function withCounty(string $county = null): self
183154
{
184155
$new = clone $this;
@@ -195,10 +166,6 @@ public function getDistrict()
195166
return $this->district;
196167
}
197168

198-
/**
199-
* @param string|null $district
200-
* @return PhotonAddress
201-
*/
202169
public function withDistrict(string $district = null): self
203170
{
204171
$new = clone $this;

Photon.php

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
use Geocoder\Collection;
1616
use Geocoder\Exception\InvalidServerResponse;
1717
use Geocoder\Exception\UnsupportedOperation;
18+
use Geocoder\Http\Provider\AbstractHttpProvider;
1819
use Geocoder\Location;
1920
use Geocoder\Model\AddressBuilder;
2021
use Geocoder\Model\AddressCollection;
22+
use Geocoder\Provider\Photon\Model\PhotonAddress;
23+
use Geocoder\Provider\Provider;
2124
use Geocoder\Query\GeocodeQuery;
2225
use Geocoder\Query\ReverseQuery;
23-
use Geocoder\Http\Provider\AbstractHttpProvider;
24-
use Geocoder\Provider\Provider;
25-
use Geocoder\Provider\Photon\Model\PhotonAddress;
2626
use Psr\Http\Client\ClientInterface;
2727

2828
/**
@@ -38,8 +38,6 @@ final class Photon extends AbstractHttpProvider implements Provider
3838

3939
/**
4040
* @param ClientInterface $client an HTTP client
41-
*
42-
* @return Photon
4341
*/
4442
public static function withKomootServer(ClientInterface $client): self
4543
{
@@ -57,9 +55,6 @@ public function __construct(ClientInterface $client, $rootUrl)
5755
$this->rootUrl = rtrim($rootUrl, '/');
5856
}
5957

60-
/**
61-
* {@inheritdoc}
62-
*/
6358
public function geocodeQuery(GeocodeQuery $query): Collection
6459
{
6560
$address = $query->getText();
@@ -91,9 +86,6 @@ public function geocodeQuery(GeocodeQuery $query): Collection
9186
return new AddressCollection($results);
9287
}
9388

94-
/**
95-
* {@inheritdoc}
96-
*/
9789
public function reverseQuery(ReverseQuery $query): Collection
9890
{
9991
$coordinates = $query->getCoordinates();
@@ -123,11 +115,6 @@ public function reverseQuery(ReverseQuery $query): Collection
123115
return new AddressCollection($results);
124116
}
125117

126-
/**
127-
* @param \stdClass $feature
128-
*
129-
* @return Location
130-
*/
131118
private function featureToAddress(\stdClass $feature): Location
132119
{
133120
$builder = new AddressBuilder($this->getName());
@@ -166,19 +153,11 @@ private function featureToAddress(\stdClass $feature): Location
166153
return $address;
167154
}
168155

169-
/**
170-
* {@inheritdoc}
171-
*/
172156
public function getName(): string
173157
{
174158
return 'photon';
175159
}
176160

177-
/**
178-
* @param string $url
179-
*
180-
* @return \stdClass
181-
*/
182161
private function executeQuery(string $url): \stdClass
183162
{
184163
$content = $this->getUrlContents($url);

Tests/PhotonTest.php

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

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

2020
class PhotonTest extends BaseTestCase
2121
{

0 commit comments

Comments
 (0)