public function enterNode(Node
$node, Environment
$env): Node
{ return $node;
} public function leaveNode(Node
$node, Environment
$env): ?Node
{ if ($node instanceof ConstantExpression
) { // constants are marked safe for all
$this->
setSafe($node,
['all'
]);
} elseif ($node instanceof BlockReferenceExpression
) { // blocks are safe by definition
$this->
setSafe($node,
['all'
]);
} elseif ($node instanceof ParentExpression
) { // parent block is safe by definition
$this->
setSafe($node,
['all'
]);
} elseif ($node instanceof ConditionalExpression
) { // intersect safeness of both operands
$safe =
$this->
intersectSafe($this->
getSafe($node->
getNode('expr2'
)),
$this->
getSafe($node->
getNode('expr3'
)));
$this->
setSafe($node,
$safe);
} elseif ($node instanceof FilterExpression
) {