Skip to content
Permalink
Browse files

feature #2202 deprecated Twig_Parser::addHandler() and Twig_Parser::a…

…ddNodeVisitor() (fabpot)

This PR was merged into the 1.x branch.

Discussion
----------

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

I don't even understand why these methods are here. It looks like they never had any usage in the core.

Commits
-------

31c444b deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
  • Loading branch information...
fabpot committed Oct 24, 2016
2 parents cefaecf + 31c444b commit 9cab8b9f376e7a0e5a4c9d8a45e27848cbfb6b50
Showing with 14 additions and 0 deletions.
  1. +1 −0 CHANGELOG
  2. +3 −0 doc/deprecated.rst
  3. +10 −0 lib/Twig/Parser.php
@@ -1,5 +1,6 @@
* 1.27.0 (2016-XX-XX)

* deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
* deprecated Twig_Compiler::addIndentation()
* fixed regression when registering two extensions having the same class name
* deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
@@ -203,3 +203,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.
@@ -208,13 +208,23 @@ public function subparse($test, $dropNeedle = false)
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;
}

0 comments on commit 9cab8b9

Please sign in to comment.
You can’t perform that action at this time.