mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 12:26:30 +00:00
Remove obsolete code
This commit is contained in:
@@ -33,8 +33,7 @@ class SetNode extends Node implements NodeCaptureInterface
|
||||
$safe = false;
|
||||
if ($capture) {
|
||||
$safe = true;
|
||||
// Node::class === get_class($values) should be removed in Twig 4.0
|
||||
if (($values instanceof Nodes || Node::class === get_class($values)) && !count($values)) {
|
||||
if ($values instanceof Nodes && !count($values)) {
|
||||
$values = new ConstantExpression('', $values->getTemplateLine());
|
||||
$capture = false;
|
||||
} elseif ($values instanceof TextNode) {
|
||||
|
||||
+1
-2
@@ -343,8 +343,7 @@ class Parser
|
||||
|
||||
// here, $nested means "being at the root level of a child template"
|
||||
// we need to discard the wrapping "Node" for the "body" node
|
||||
// Node::class !== \get_class($node) should be removed in Twig 4.0
|
||||
$nested = $nested || (Node::class !== \get_class($node) && !$node instanceof Nodes);
|
||||
$nested = $nested || !$node instanceof Nodes;
|
||||
foreach ($node as $k => $n) {
|
||||
if (null !== $n && null === $this->filterBodyNodes($n, $nested)) {
|
||||
$node->removeNode($k);
|
||||
|
||||
Reference in New Issue
Block a user