8000 Add PHP Coding Standards Fixer in CI (#1196) · geocoder-php/plugin@f3f4fc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3f4fc9

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 0d0c406 commit f3f4fc9

12 files changed

+4
-89
lines changed

Exception/LoopException.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public static function create($message, Query $query)
3535
return $ex;
3636
}
3737

38-
/**
39-
* @return Query
40-
*/
4138
public function getQuery(): Query
4239
{
4340
return $this->query;

Plugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ interface Plugin
3131
/**
3232
* Handle the Query and return the Collection coming from the next callable.
3333
*
34-
* @param Query $query
3534
* @param callable $next Next middleware in the chain, the query is passed as the first argument
3635
* @param callable $first First middleware in the chain, used to to restart a request
3736
*

Plugin/BoundsPlugin.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,11 @@ class BoundsPlugin implements Plugin
2929
*/
3030
private $bounds;
3131

32-
/**
33-
* @param Bounds $bounds
34-
*/
3532
public function __construct(Bounds $bounds)
3633
{
3734
$this->bounds = $bounds;
3835
}
3936

40-
/**
41-
* {@inheritdoc}
42-
*/
4337
public function handleQuery(Query $query, callable $next, callable $first)
4438
{
4539
if (!$query instanceof GeocodeQuery) {

Plugin/CachePlugin.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,13 @@ class CachePlugin implements Plugin
4242
*/
4343
private $precision;
4444

45-
/**
46-
* @param CacheInterface $cache
47-
* @param int|null $lifetime
48-
* @param int|null $precision
49-
*/
5045
public function __construct(CacheInterface $cache, int $lifetime = null, int $precision = null)
5146
{
5247
$this->cache = $cache;
5348
$this->lifetime = $lifetime;
5449
$this->precision = $precision;
5550
}
5651

57-
/**
58-
* {@inheritdoc}
59-
*/
6052
public function handleQuery(Query $query, callable $next, callable $first)
6153
{
6254
$cacheKey = $this->getCacheKey($query);
@@ -70,11 +62,6 @@ public function handleQuery(Query $query, callable $next, callable $first)
7062
return $result;
7163
}
7264

73-
/**
74-
* @param Query $query
75-
*
76-
* @return string
77-
*/
7865
private function getCacheKey(Query $query): string
7966
{
8067
if (null !== $this->precision && $query instanceof ReverseQuery) {

Plugin/LimitPlugin.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,11 @@ class LimitPlugin implements Plugin
2727
*/
2828
private $limit;
2929

30-
/**
31-
* @param int $limit
32-
*/
3330
public function __construct(int $limit)
3431
{
3532
$this->limit = $limit;
3633
}
3734

38-
/**
39-
* {@inheritdoc}
40-
*/
4135
public function handleQuery(Query $query, callable $next, callable $first)
4236
{
4337
$limit = $query->getLimit();

Plugin/LocalePlugin.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,11 @@ class LocalePlugin implements Plugin
2727
*/
2828
private $locale;
2929

30-
/**
31-
* @param string $locale
32-
*/
3330
public function __construct(string $locale)
3431
{
3532
$this->locale = $locale;
3633
}
3734

38-
/**
39-
* {@inheritdoc}
40-
*/
4135
public function handleQuery(Query $query, callable $next, callable $first)
4236
{
4337
$locale = $query->getLocale();

Plugin/LoggerPlugin.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class LoggerPlugin implements Plugin
3030
*/
3131
private $logger;
3232

33-
/**
34-
* @param LoggerInterface $logger
35-
*/
3633
public function __construct(LoggerInterface $logger)
3734
{
3835
$this->logger = $logger;

Plugin/QueryDataPlugin.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@ class QueryDataPlugin implements Plugin
3333
private $force;
3434

3535
/**
36-
* @param array $data
37-
* @param bool $force If true we overwrite existing values
36+
* @param bool $force If true we overwrite existing values
3837
*/
3938
public function __construct(array $data, $force = false)
4039
{
4140
$this->data = $data;
4241
$this->force = $force;
4342
}
4443

45-
/**
46-
* {@inheritdoc}
47-
*/
4844
public function handleQuery(Query $query, callable $next, callable $first)
4945
{
5046
$queryData = $query->getAllData();

PluginProvider.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
use Geocoder\Collection;
1616
use Geocoder\Exception\Exception;
1717
use Geocoder\Exception\LogicException;
18+
use Geocoder\Plugin\Exception\LoopException;
1819
use Geocoder\Plugin\Promise\GeocoderFulfilledPromise;
1920
use Geocoder\Plugin\Promise\GeocoderRejectedPromise;
2021
use Geocoder\Provider\Provider;
2122
use Geocoder\Query\GeocodeQuery;
2223
use Geocoder\Query\Query;
2324
use Geocoder\Query\ReverseQuery;
24-
use Geocoder\Plugin\Exception\LoopException;
2525

2626
/**
2727
* @author Joel Wurtz <joel.wurtz@gmail.com>
@@ -47,8 +47,7 @@ class PluginProvider implements Provider
4747
private $options;
4848

4949
/**
50-
* @param Provider $provider
51-
* @param Plugin[] $plugins
50+
* @param Plugin[] $plugins
5251
* @param array{max_restarts?: int<0, max>} $options
5352
*/
5453
public function __construct(Provider $provider, array $plugins = [], array $options = [])
@@ -58,9 +57,6 @@ public function __construct(Provider $provider, array $plugins = [], array $opti
5857
$this->options = $this->configure($options);
5958
}
6059

61-
/**
62-
* {@inheritdoc}
63-
*/
6460
public function geocodeQuery(GeocodeQuery $query): Collection
6561
{
6662
$pluginChain = $this->createPluginChain($this->plugins, function (GeocodeQuery $query) {
@@ -74,9 +70,6 @@ public function geocodeQuery(GeocodeQuery $query): Collection
7470
return $pluginChain($query)->wait();
7571
}
7672

77-
/**
78-
* {@inheritdoc}
79-
*/
8073
public function reverseQuery(ReverseQuery $query): Collection
8174
{
8275
$pluginChain = $this->createPluginChain($this->plugins, function (ReverseQuery $query) {
@@ -90,20 +83,13 @@ public function reverseQuery(ReverseQuery $query): Collection
9083
return $pluginChain($query)->wait();
9184
}
9285

93-
/**
94-
* {@inheritdoc}
95-
*/
9686
public function getName(): string
9787
{
9888
return $this->provider->getName();
9989
}
10090

10191
/**
10292
* Configure the plugin provider.
103-
*
104-
* @param array $options
105-
*
106-
* @return array
10793
*/
10894
private function configure(array $options = []): array
10995
{

Promise/GeocoderFulfilledPromise.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,11 @@ final class GeocoderFulfilledPromise implements Promise
2525
*/
2626
private $collection;
2727

28-
/**
29-
* @param Collection $collection
30-
*/
3128
public function __construct(Collection $collection)
3229
{
3330
$this->collection = $collection;
3431
}
3532

36-
/**
37-
* {@inheritdoc}
38-
*/
3933
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
4034
{
4135
if (null === $onFulfilled) {
@@ -49,19 +43,11 @@ public function then(callable $onFulfilled = null, callable $onRejected = null):
4943
}
5044
}
5145

52-
/**
53-
* {@inheritdoc}
54-
*/
5546
public function getState(): string
5647
{
5748
return Promise::FULFILLED;
5849
}
5950

60-
/**
61-
* {@inheritdoc}
62-
*
63-
* @return mixed
64-
*/
6551
public function wait($unwrap = true)
6652
{
6753
if ($unwrap) {

Promise/GeocoderRejectedPromise.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,11 @@ final class GeocoderRejectedPromise implements Promise
2424
*/
2525
private $exception;
2626

27-
/**
28-
* @param Exception $exception
29-
*/
3027
public function __construct(Exception $exception)
3128
{
3229
$this->exception = $exception;
3330
}
3431

35-
/**
36-
* {@inheritdoc}
37-
*/
3832
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
3933
{
4034
if (null === $onRejected) {
@@ -48,19 +42,11 @@ public function then(callable $onFulfilled = null, callable $onRejected = null):
4842
}
4943
}
5044

51-
/**
52-
* {@inheritdoc}
53-
*/
5445
public function getState(): string
5546
{
5647
return Promise::REJECTED;
5748
}
5849

59-
/**
60-
* {@inheritdoc}
61-
*
62-
* @return mixed
63-
*/
6450
public function wait($unwrap = true)
6551
{
6652
if ($unwrap) {

Tests/Plugin/CachePluginTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace Geocoder\Plugin\Tests\Plugin;
1414

1515
use Cache\Adapter\Void\VoidCachePool;
16-
use Generator;
1716
use Geocoder\Model\Coordinates;
1817
use Geocoder\Plugin\Plugin\CachePlugin;
1918
use Geocoder\Query\GeocodeQuery;
@@ -53,7 +52,7 @@ public function testPluginMiss()
5352
$this->assertEquals('result', $plugin->handleQuery($query, $next, $first));
5453
}
5554

56-
public function getQueryProvider(): Generator
55+
public function getQueryProvider(): \Generator
5756
{
5857
$query = GeocodeQuery::create('foo');
5958
$key = sha1($query->__toString());

0 commit comments

Comments
 (0)
0