function Environment::removeCache
File
-
vendor/
twig/ twig/ src/ Environment.php, line 238
Class
- Environment
- Stores the Twig configuration and renders templates.
Namespace
TwigCode
public function removeCache(string $name) : void {
$cls = $this->getTemplateClass($name);
$this->hotCache[$name] = $cls . '_' . bin2hex(random_bytes(16));
if ($this->cache instanceof RemovableCacheInterface) {
$this->cache
->remove($name, $cls);
}
else {
throw new \LogicException(\sprintf('The "%s" cache class does not support removing template cache as it does not implement the "RemovableCacheInterface" interface.', \get_class($this->cache)));
}
}