CacheClearerInterface.php
2 years ago
ChainCacheClearer.php
2 years ago
Psr6CacheClearer.php
2 years ago
ChainCacheClearer.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\HttpKernel\CacheClearer; |
| 12 | |
| 13 | /** |
| 14 | * ChainCacheClearer. |
| 15 | * |
| 16 | * @author Dustin Dobervich <ddobervich@gmail.com> |
| 17 | * |
| 18 | * @final |
| 19 | */ |
| 20 | class ChainCacheClearer implements CacheClearerInterface |
| 21 | { |
| 22 | private $clearers; |
| 23 | /** |
| 24 | * @param iterable<mixed, CacheClearerInterface> $clearers |
| 25 | */ |
| 26 | public function __construct(iterable $clearers = []) |
| 27 | { |
| 28 | $this->clearers = $clearers; |
| 29 | } |
| 30 | /** |
| 31 | * {@inheritdoc} |
| 32 | */ |
| 33 | public function clear(string $cacheDir) |
| 34 | { |
| 35 | foreach ($this->clearers as $clearer) { |
| 36 | $clearer->clear($cacheDir); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 |