comparison vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
18 */ 18 */
19 class Psr6CacheClearer implements CacheClearerInterface 19 class Psr6CacheClearer implements CacheClearerInterface
20 { 20 {
21 private $pools = array(); 21 private $pools = array();
22 22
23 public function __construct(array $pools = array())
24 {
25 $this->pools = $pools;
26 }
27
23 public function addPool(CacheItemPoolInterface $pool) 28 public function addPool(CacheItemPoolInterface $pool)
24 { 29 {
30 @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);
31
25 $this->pools[] = $pool; 32 $this->pools[] = $pool;
33 }
34
35 public function hasPool($name)
36 {
37 return isset($this->pools[$name]);
38 }
39
40 public function clearPool($name)
41 {
42 if (!isset($this->pools[$name])) {
43 throw new \InvalidArgumentException(sprintf('Cache pool not found: %s.', $name));
44 }
45
46 return $this->pools[$name]->clear();
26 } 47 }
27 48
28 /** 49 /**
29 * {@inheritdoc} 50 * {@inheritdoc}
30 */ 51 */