Add the possibility to reset globals

This commit is contained in:
Fabien Potencier
2024-09-07 15:05:45 +02:00
parent 6a76881e05
commit ef58791fa4
6 changed files with 52 additions and 6 deletions
+6
View File
@@ -830,6 +830,12 @@ class Environment
return array_merge($this->extensionSet->getGlobals(), $this->globals);
}
public function resetGlobals(): void
{
$this->resolvedGlobals = null;
$this->extensionSet->resetGlobals();
}
/**
* @deprecated since Twig 3.13
*/