mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-26 21:55:57 +00:00
Merge branch '3.x' into 4.x
* 3.x: Improve the way one can deprecate a Twig callable Bump version Prepare the 3.14.0 release Fix a security issue when an included sandboxed template has been loaded before without the sandbox context Fix test fix the version mergeGlobals() is deprecated since Tweak code Fix CS Add more tests Remove unused private methods Bump version
This commit is contained in:
@@ -719,15 +719,8 @@ class ExpressionParser
|
||||
|
||||
if ($test->isDeprecated()) {
|
||||
$stream = $this->parser->getStream();
|
||||
$message = \sprintf('Twig Test "%s" is deprecated', $test->getName());
|
||||
|
||||
if ($test->getAlternative()) {
|
||||
$message .= \sprintf('. Use "%s" instead', $test->getAlternative());
|
||||
}
|
||||
$src = $stream->getSourceContext();
|
||||
$message .= \sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine());
|
||||
|
||||
trigger_deprecation($test->getDeprecatingPackage(), $test->getDeprecatedVersion(), $message);
|
||||
$test->triggerDeprecation($src->getPath() ?: $src->getName(), $stream->getCurrent()->getLine());
|
||||
}
|
||||
|
||||
return $test;
|
||||
@@ -743,14 +736,8 @@ class ExpressionParser
|
||||
}
|
||||
|
||||
if ($function->isDeprecated()) {
|
||||
$message = \sprintf('Twig Function "%s" is deprecated', $function->getName());
|
||||
if ($function->getAlternative()) {
|
||||
$message .= \sprintf('. Use "%s" instead', $function->getAlternative());
|
||||
}
|
||||
$src = $this->parser->getStream()->getSourceContext();
|
||||
$message .= \sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
|
||||
|
||||
trigger_deprecation($function->getDeprecatingPackage(), $function->getDeprecatedVersion(), $message);
|
||||
$function->triggerDeprecation($src->getPath() ?: $src->getName(), $line);
|
||||
}
|
||||
|
||||
return $function;
|
||||
@@ -766,14 +753,8 @@ class ExpressionParser
|
||||
}
|
||||
|
||||
if ($filter->isDeprecated()) {
|
||||
$message = \sprintf('Twig Filter "%s" is deprecated', $filter->getName());
|
||||
if ($filter->getAlternative()) {
|
||||
$message .= \sprintf('. Use "%s" instead', $filter->getAlternative());
|
||||
}
|
||||
$src = $this->parser->getStream()->getSourceContext();
|
||||
$message .= \sprintf(' in %s at line %d.', $src->getPath() ?: $src->getName(), $line);
|
||||
|
||||
trigger_deprecation($filter->getDeprecatingPackage(), $filter->getDeprecatedVersion(), $message);
|
||||
$filter->triggerDeprecation($src->getPath() ?: $src->getName(), $line);
|
||||
}
|
||||
|
||||
return $filter;
|
||||
|
||||
Reference in New Issue
Block a user