deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()

This commit is contained in:
Fabien Potencier
2016-10-23 13:50:47 -07:00
parent c97f3b85c3
commit 31c444b511
3 changed files with 14 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
* 1.27.0 (2016-XX-XX)
* deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
* fixed regression when registering two extensions having the same class name
* deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
* fixed the filesystem loader with relative paths
+3
View File
@@ -200,3 +200,6 @@ Miscellaneous
* As of Twig 1.27, ``Twig_Template::getSource()`` is deprecated. Use
``Twig_Template::getSourceContext()`` instead.
* As of Twig 1.27, ``Twig_Parser::addHandler()`` and
``Twig_Parser::addNodeVisitor()`` are deprecated and will be removed in 2.0.
+10
View File
@@ -207,13 +207,23 @@ class Twig_Parser implements Twig_ParserInterface
return new Twig_Node($rv, array(), $lineno);
}
/**
* @deprecated since 1.27 (to be removed in 2.0)
*/
public function addHandler($name, $class)
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED);
$this->handlers[$name] = $class;
}
/**
* @deprecated since 1.27 (to be removed in 2.0)
*/
public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED);
$this->visitors[] = $visitor;
}