You are here

final public function Twig_BaseNodeVisitor::leaveNode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/BaseNodeVisitor.php \Twig_BaseNodeVisitor::leaveNode()

Called after child nodes are visited.

Parameters

Twig_NodeInterface $node The node to visit:

Twig_Environment $env The Twig environment instance:

Return value

Twig_NodeInterface|false The modified node or false if the node must be removed

Overrides Twig_NodeVisitorInterface::leaveNode

File

vendor/twig/twig/lib/Twig/BaseNodeVisitor.php, line 34

Class

Twig_BaseNodeVisitor
Twig_BaseNodeVisitor can be used to make node visitors compatible with Twig 1.x and 2.x.

Code

public final function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) {
  if (!$node instanceof Twig_Node) {
    throw new LogicException('Twig_BaseNodeVisitor only supports Twig_Node instances.');
  }
  return $this
    ->doLeaveNode($node, $env);
}