deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode()

This commit is contained in:
Fabien Potencier
2019-04-26 11:42:14 +02:00
parent 11cc08aa2f
commit 8faef9331b
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
* 2.9.0 (2019-XX-XX) * 2.9.0 (2019-XX-XX)
* deprecated returning "false" to remove a Node from NodeVisitorInterface::leaveNode()
* allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning)
* deprecated the "filter" tag (use the "apply" tag instead) * deprecated the "filter" tag (use the "apply" tag instead)
* added the "apply" tag as a replacement for the "filter" tag * added the "apply" tag as a replacement for the "filter" tag
+4
View File
@@ -70,6 +70,10 @@ final class NodeTraverser
$node->setNode($k, $m); $node->setNode($k, $m);
} }
} else { } else {
if (false === $m) {
@trigger_error('Returning "false" to remove a Node from NodeVisitorInterface::leaveNode() is deprecated since Twig version 2.9; return "null" instead.', E_USER_DEPRECATED);
}
$node->removeNode($k); $node->removeNode($k);
} }
} }