class Psr6CacheClearer
@author Nicolas Grekas <p@tchwork.com>
Hierarchy
- class \Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer implements \Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface
Expanded class hierarchy of Psr6CacheClearer
File
-
vendor/
symfony/ http-kernel/ CacheClearer/ Psr6CacheClearer.php, line 19
Namespace
Symfony\Component\HttpKernel\CacheClearerView source
class Psr6CacheClearer implements CacheClearerInterface {
private array $pools = [];
/**
* @param array<string, CacheItemPoolInterface> $pools
*/
public function __construct(array $pools = []) {
$this->pools = $pools;
}
public function hasPool(string $name) : bool {
return isset($this->pools[$name]);
}
/**
* @throws \InvalidArgumentException If the cache pool with the given name does not exist
*/
public function getPool(string $name) : CacheItemPoolInterface {
if (!$this->hasPool($name)) {
throw new \InvalidArgumentException(\sprintf('Cache pool not found: "%s".', $name));
}
return $this->pools[$name];
}
/**
* @throws \InvalidArgumentException If the cache pool with the given name does not exist
*/
public function clearPool(string $name) : bool {
if (!isset($this->pools[$name])) {
throw new \InvalidArgumentException(\sprintf('Cache pool not found: "%s".', $name));
}
return $this->pools[$name]
->clear();
}
public function clear(string $cacheDir) : void {
foreach ($this->pools as $pool) {
$pool->clear();
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
Psr6CacheClearer::$pools | private | property | ||
Psr6CacheClearer::clear | public | function | Clears any caches necessary. | Overrides CacheClearerInterface::clear |
Psr6CacheClearer::clearPool | public | function | ||
Psr6CacheClearer::getPool | public | function | ||
Psr6CacheClearer::hasPool | public | function | ||
Psr6CacheClearer::__construct | public | function |