NodeTraverser
in package
A node traverser.
It visits all nodes and their children and calls the given visitor for each.
Tags
Table of Contents
- $env : mixed
- $visitors : mixed
- __construct() : mixed
- addVisitor() : mixed
- traverse() : Node
- Traverses a node and calls the registered visitors.
- traverseForVisitor() : Node|null
Properties
$env
private
mixed
$env
$visitors
private
mixed
$visitors
= []
Methods
__construct()
public
__construct(Environment $env[, array<string|int, NodeVisitorInterface> $visitors = [] ]) : mixed
Parameters
- $env : Environment
- $visitors : array<string|int, NodeVisitorInterface> = []
Return values
mixed —addVisitor()
public
addVisitor(NodeVisitorInterface $visitor) : mixed
Parameters
- $visitor : NodeVisitorInterface
Return values
mixed —traverse()
Traverses a node and calls the registered visitors.
public
traverse(Node $node) : Node
Parameters
- $node : Node
Return values
Node —traverseForVisitor()
private
traverseForVisitor(NodeVisitorInterface $visitor, Node $node) : Node|null
Parameters
- $visitor : NodeVisitorInterface
- $node : Node