Skip to content

Commit e3eb3b2

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 876c5ae commit e3eb3b2

36 files changed

+33
-481
lines changed

Assert.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
class Assert
1818
{
1919
/**
20-
* @param float $value
21-
* @param string $message
20+
* @param float $value
2221
*/
2322
public static function latitude($value, string $message = '')
2423
{
@@ -29,8 +28,7 @@ public static function latitude($value, string $message = '')
2928
}
3029

3130
/**
32-
* @param float $value
33-
* @param string $message
31+
* @param float $value
3432
*/
3533
public static function longitude($value, string $message = '')
3634
{
@@ -40,10 +38,6 @@ public static function longitude($value, string $message = '')
4038
}
4139
}
4240

43-
/**
44-
* @param mixed $value
45-
* @param string $message
46-
*/
4741
public static function notNull($value, string $message = '')
4842
{
4943
if (null === $value) {
@@ -56,10 +50,6 @@ private static function typeToString($value): string
5650
return is_object($value) ? get_class($value) : gettype($value);
5751
}
5852

59-
/**
60-
* @param $value
61-
* @param $message
62-
*/
6353
private static function float($value, string $message)
6454
{
6555
if (!is_float($value)) {

Collection.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,20 @@
2626
interface Collection extends \IteratorAggregate, \Countable
2727
{
2828
/**
29-
* @return Location
30-
*
3129
* @throws CollectionIsEmpty
3230
*/
3331
public function first(): Location;
3432

35-
/**
36-
* @return bool
37-
*/
3833
public function isEmpty(): bool;
3934

4035
/**
4136
* @return Location[]
4237
*/
4338
public function slice(int $offset, int $length = null);
4439

45-
/**
46-
* @return bool
47-
*/
4840
public function has(int $index): bool;
4941

5042
/**
51-
* @return Location
52-
*
5343
* @throws OutOfBounds
5444
*/
5545
public function get(int $index): Location;

Dumper/AbstractArrayDumper.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
*/
2020
abstract class AbstractArrayDumper
2121
{
22-
/**
23-
* @param Location $location
24-
*
25-
* @return array
26-
*/
2722
protected function getArray(Location $location): array
2823
{
2924
$properties = array_filter($location->toArray(), function ($value) {

Dumper/AbstractDumper.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
abstract class AbstractDumper
1818
{
19-
/**
20-
* @param Location $address
21-
*
22-
* @return string
23-
*/
2419
protected function formatName(Location $address): string
2520
{
2621
$name = [];

Dumper/Dumper.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ interface Dumper
2222
/**
2323
* Dumps an `Location` object as a string representation of
2424
* the implemented format.
25-
*
26-
* @param Location $location
27-
*
28-
* @return mixed
2925
*/
3026
public function dump(Location $location);
3127
}

Dumper/GeoArray.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
*/
2020
final class GeoArray extends AbstractArrayDumper implements Dumper
2121
{
22-
/**
23-
* {@inheritdoc}
24-
*/
2522
public function dump(Location $location): array
2623
{
2724
return $this->getArray($location);

Dumper/GeoJson.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
*/
2020
final class GeoJson extends AbstractArrayDumper implements Dumper
2121
{
22-
/**
23-
* {@inheritdoc}
24-
*/
2522
public function dump(Location $location): string
2623
{
2724
return json_encode($this->getArray($location));

Dumper/Gpx.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
*/
2121
final class Gpx extends AbstractDumper implements Dumper
2222
{
23-
/**
24-
* @param Location $location
25-
*
26-
* @return string
27-
*/
2823
public function dump(Location $location): string
2924
{
3025
$gpx = sprintf(<<<'GPX'
@@ -37,14 +32,14 @@ public function dump(Location $location): string
3732
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
3833

3934
GPX
40-
, Geocoder::VERSION);
35+
, Geocoder::VERSION);
4136

4237
if (null !== $bounds = $location->getBounds()) {
4338
$gpx .= sprintf(<<<'GPX'
4439
<bounds minlat="%f" minlon="%f" maxlat="%f" maxlon="%f"/>
4540

4641
GPX
47-
, $bounds->getWest(), $bounds->getSouth(), $bounds->getEast(), $bounds->getNorth());
42+
, $bounds->getWest(), $bounds->getSouth(), $bounds->getEast(), $bounds->getNorth());
4843
}
4944

5045
$lat = null;
@@ -61,7 +56,7 @@ public function dump(Location $location): string
6156
</wpt>
6257

6358
GPX
64-
, $lat, $lon, $this->formatName($location));
59+
, $lat, $lon, $this->formatName($location));
6560

6661
$gpx .= <<<'GPX'
6762
</gpx>

Dumper/Kml.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
*/
2020
final class Kml extends AbstractDumper implements Dumper
2121
{
22-
/**
23-
* {@inheritdoc}
24-
*/
2522
public function dump(Location $location): string
2623
{
2724
$name = $this->formatName($location);

Dumper/Wkb.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
*/
2020
final class Wkb implements Dumper
2121
{
22-
/**
23-
* {@inheritdoc}
24-
*/
2522
public function dump(Location $location): string
2623
{
2724
$lat = null;

0 commit comments

Comments
 (0)