Skip to content

Commit

Permalink
Add PHP Coding Standards Fixer in CI (#1196)
Browse files Browse the repository at this point in the history
* Update composer.json

* Update .gitignore

* Update php.yml

* Apply PHPCSFixer fixes

* Switch to php-cs-fixer/shim

* Create .php-cs-fixer.dist.php
  • Loading branch information
jbelien committed Jul 21, 2023
1 parent ced6d18 commit bd3df17
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions ProviderCache.php
Expand Up @@ -13,9 +13,9 @@
namespace Geocoder\Provider\Cache;

use Geocoder\Collection;
use Geocoder\Provider\Provider;
use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;
use Geocoder\Provider\Provider;
use Psr\SimpleCache\CacheInterface;

/**
Expand All @@ -41,14 +41,12 @@ class ProviderCache implements Provider
protected $lifetime;

/**
* If true, include the real provider name into the cache key
* If true, include the real provider name into the cache key.
*/
private bool $separateCache;

/**
* @param Provider $realProvider
* @param CacheInterface $cache
* @param int $lifetime
* @param int $lifetime
*/
final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null, bool $separateCache = false)
{
Expand All @@ -58,9 +56,6 @@ final public function __construct(Provider $realProvider, CacheInterface $cache,
$this->separateCache = $separateCache;
}

/**
* {@inheritdoc}
*/
final public function geocodeQuery(GeocodeQuery $query): Collection
{
$cacheKey = $this->getCacheKey($query);
Expand All @@ -74,9 +69,6 @@ final public function geocodeQuery(GeocodeQuery $query): Collection
return $result;
}

/**
* {@inheritdoc}
*/
final public function reverseQuery(ReverseQuery $query): Collection
{
$cacheKey = $this->getCacheKey($query);
Expand All @@ -90,9 +82,6 @@ final public function reverseQuery(ReverseQuery $query): Collection
return $result;
}

/**
* {@inheritdoc}
*/
public function getName(): string
{
return sprintf('%s (cache)', $this->realProvider->getName());
Expand All @@ -105,8 +94,6 @@ final public function __call($method, $args)

/**
* @param GeocodeQuery|ReverseQuery $query
*
* @return string
*/
protected function getCacheKey($query): string
{
Expand Down

0 comments on commit bd3df17

Please sign in to comment.