diff --git a/composer.json b/composer.json index 5c0251ec5b55605be7ba58cf325e70a3722f4cf2..0c59b08132bbf30317e276e5bd826c4e1f17a245 100644 --- a/composer.json +++ b/composer.json @@ -14,9 +14,6 @@ "ext-json": "*", "beberlei/assert": "^3.2", "friendsofphp/php-cs-fixer": "^2.16", - "symfony/event-dispatcher-contracts": "^1.1", - "symfony/cache": "^4.3", - "symfony/cache-contracts": "^1.1" }, "require-dev": { "irstea/composer-require-checker-shim": "^2.0.0", diff --git a/src/Config.php b/src/Config.php index 032e645241340994f94ca5753d53b3c8b94b54eb..ccf5e754a426049be3d8647d85b7fb9aec844355 100644 --- a/src/Config.php +++ b/src/Config.php @@ -13,7 +13,6 @@ namespace Irstea\CS; use Irstea\CS\Composer\ComposerPackage; use Irstea\CS\Composer\ComposerPackageInterface; use Irstea\CS\FileLocator\FileLocator; -use Irstea\CS\Git\CachedGitRepository; use Irstea\CS\Git\GitRepository; use Irstea\CS\HeaderComment\ChainTemplateProvider; use Irstea\CS\HeaderComment\FormattedHeaderProvider; @@ -22,7 +21,6 @@ use Irstea\CS\HeaderComment\LicenseTemplateProvider; use Irstea\CS\HeaderComment\TemplateFormatter; use Irstea\CS\HeaderComment\UserDefinedTemplateProvider; use PhpCsFixer\Config as PhpCsFixerConfig; -use Symfony\Component\Cache\Adapter\ArrayAdapter; /** * Class Config. @@ -168,10 +166,7 @@ final class Config extends PhpCsFixerConfig $fileLocator = new FileLocator($callerPath); $composerPackage = new ComposerPackage($fileLocator); - $cache = new ArrayAdapter(); - - $backendGitRepository = new GitRepository($callerPath); - $gitRepository = new CachedGitRepository($backendGitRepository, $cache); + $gitRepository = new GitRepository($callerPath); $headerProvider = new FormattedHeaderProvider( new ChainTemplateProvider( diff --git a/src/Git/CachedGitRepository.php b/src/Git/CachedGitRepository.php deleted file mode 100644 index 52fc383f65ec5a6b44c1015556367a8f33f06cbc..0000000000000000000000000000000000000000 --- a/src/Git/CachedGitRepository.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php declare(strict_types=1); -/* - * irstea/php-cs-fixer-config - Jeux de règles pour php-cs-fixer. - * Copyright (C) 2018-2020 IRSTEA - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - */ - -namespace Irstea\CS\Git; - -use Symfony\Contracts\Cache\CacheInterface; - -/** - * Class CachedGitRepository. - */ -final class CachedGitRepository implements GitRepositoryInterface -{ - /** - * @var GitRepositoryInterface - */ - private $inner; - - /** - * @var CacheInterface - */ - private $cache; - - /** - * CachedGitRepository constructor. - */ - public function __construct(GitRepositoryInterface $inner, CacheInterface $cache) - { - $this->inner = $inner; - $this->cache = $cache; - } - - /** - * {@inheritdoc} - */ - public function getHeadCommit(): string - { - // Jamais mis en cache ! - return $this->inner->getHeadCommit(); - } - - /** - * {@inheritdoc} - */ - public function getYearRange(): string - { - return $this->cache->get('git.year-range', [$this->inner, 'getYearRange']); - } -}