Visitor that connects a child node to its parent node as well as its sibling nodes.
With $weakReferences=false on the child node, the parent node can be accessed through $node->getAttribute('parent'), the previous node can be accessed through $node->getAttribute('previous'), and the next node can be accessed through $node->getAttribute('next').
With $weakReferences=true attribute names are prefixed by "weak_", e.g. "weak_parent".
CloneableFinalInstantiable
Constants |
Methods |
public __construct(bool $weakReferences = false) |
public beforeTraverse(array $nodes) |
public enterNode(PhpParser |
public leaveNode(PhpParser |
Properties |
private $previous = NULL
|
private array $stack = []
|
private bool $weakReferences |