Skip to content

Commit

Permalink
feature #4019 Add a deprecation notice when using AbstractNodeVisitor…
Browse files Browse the repository at this point in the history
… (deprecated since 2.9) (fabpot)

This PR was merged into the 3.x branch.

Discussion
----------

Add a deprecation notice when using AbstractNodeVisitor (deprecated since 2.9)

Commits
-------

41d702d Add a deprecation notice when using AbstractNodeVisitor (deprecated since 2.9)
  • Loading branch information
fabpot committed Apr 14, 2024
2 parents fe2bdd2 + 41d702d commit f6d620c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 3.9.0 (2024-XX-XX)

* Deprecate AbstractNodeVisitor
* Add a new "yield" mode for output generation;
Node implementations that use "echo" or "print" should use "yield" instead;
all Node implementations should be flagged with `#[YieldReady]` once they've been made ready for "yield";
Expand Down
6 changes: 6 additions & 0 deletions doc/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ Extensions
* All functions defined in Twig extensions are marked as internal as of Twig
3.9.0, and will be removed in Twig 4.0. They have been replaced by internal
methods on their respective extension classes.

Node Visitors
-------------

* The ``Twig\NodeVisitor\AbstractNodeVisitor`` class is deprecated, implement the
``Twig\NodeVisitor\NodeVisitorInterface`` interface instead.
4 changes: 2 additions & 2 deletions src/NodeVisitor/AbstractNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
/**
* Used to make node visitors compatible with Twig 1.x and 2.x.
*
* To be removed in Twig 3.1.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @deprecated since 3.9 (to be removed in 4.0)
*/
abstract class AbstractNodeVisitor implements NodeVisitorInterface
{
Expand Down

0 comments on commit f6d620c

Please sign in to comment.