X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-kernel%2FCacheClearer%2FPsr6CacheClearer.php;fp=vendor%2Fsymfony%2Fhttp-kernel%2FCacheClearer%2FPsr6CacheClearer.php;h=d413d2c9d641d18952a305be9e599ed50a221ce1;hp=30261b3f7c66066816346ced6d5c2977eccc7a0e;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php b/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php index 30261b3f7..d413d2c9d 100644 --- a/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php +++ b/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php @@ -20,11 +20,32 @@ class Psr6CacheClearer implements CacheClearerInterface { private $pools = array(); + public function __construct(array $pools = array()) + { + $this->pools = $pools; + } + public function addPool(CacheItemPoolInterface $pool) { + @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass an array of pools indexed by name to the constructor instead.', __METHOD__), E_USER_DEPRECATED); + $this->pools[] = $pool; } + public function hasPool($name) + { + return isset($this->pools[$name]); + } + + public function clearPool($name) + { + if (!isset($this->pools[$name])) { + throw new \InvalidArgumentException(sprintf('Cache pool not found: %s.', $name)); + } + + return $this->pools[$name]->clear(); + } + /** * {@inheritdoc} */