trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated and not needed if you are using methods from "Twig\Runtime\EscaperRuntime".',__METHOD__);
trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated and not needed if you are using methods from "Twig\Runtime\EscaperRuntime".',__METHOD__);
$this->escaper=$escaper;
}
/**
* Sets the default strategy to use when not defined by the user.
*
* The strategy can be a valid PHP callback that takes the template
* name as an argument and returns the strategy to use.
*
* @param string|false|callable(string $templateName): string $defaultStrategy An escaping strategy
trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::setEscaper()" method instead (be warned that Environment is not passed anymore to the callable).',__METHOD__);
if(!isset($this->environment)){
thrownew\LogicException(\sprintf('You must call "setEnvironment()" before calling "%s()".',__METHOD__));
* @return array<string, callable(Environment, string, string): string> An array of escapers
*
* @deprecated since Twig 3.10
*/
publicfunctiongetEscapers()
{
trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::getEscaper()" method instead.',__METHOD__);
trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::setSafeClasses()" method instead.',__METHOD__);
if(!isset($this->escaper)){
thrownew\LogicException(\sprintf('You must call "setEnvironment()" before calling "%s()".',__METHOD__));
trigger_deprecation('twig/twig','3.10','The "%s()" method is deprecated, use the "Twig\Runtime\EscaperRuntime::addSafeClass()" method instead.',__METHOD__);
if(!isset($this->escaper)){
thrownew\LogicException(\sprintf('You must call "setEnvironment()" before calling "%s()".',__METHOD__));