mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
readded code lost in master
This commit is contained in:
@@ -574,6 +574,16 @@ class Twig_ExpressionParser
|
||||
throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
|
||||
}
|
||||
|
||||
if ($function->isDeprecated()) {
|
||||
$message = sprintf('Twig Function "%s" is deprecated', $function->getName());
|
||||
if ($test->getAlternative()) {
|
||||
$message .= sprintf('. Use "%s" instead', $function->getAlternative());
|
||||
}
|
||||
$message .= sprintf(' in %s at line %d.', $this->parser->getFilename(), $line);
|
||||
|
||||
@trigger_error($message, E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
return $function->getNodeClass();
|
||||
}
|
||||
|
||||
@@ -590,6 +600,16 @@ class Twig_ExpressionParser
|
||||
throw new Twig_Error_Syntax($message, $line, $this->parser->getFilename());
|
||||
}
|
||||
|
||||
if ($filter->isDeprecated()) {
|
||||
$message = sprintf('Twig Filter "%s" is deprecated', $filter->getName());
|
||||
if ($test->getAlternative()) {
|
||||
$message .= sprintf('. Use "%s" instead', $filter->getAlternative());
|
||||
}
|
||||
$message .= sprintf(' in %s at line %d.', $this->parser->getFilename(), $line);
|
||||
|
||||
@trigger_error($message, E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
return $filter->getNodeClass();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user