Chris@13: $node stays as-is Chris@0: * * NodeTraverser::DONT_TRAVERSE_CHILDREN Chris@0: * => Children of $node are not traversed. $node stays as-is Chris@0: * * NodeTraverser::STOP_TRAVERSAL Chris@0: * => Traversal is aborted. $node stays as-is Chris@0: * * otherwise Chris@0: * => $node is set to the return value Chris@0: * Chris@0: * @param Node $node Node Chris@0: * Chris@13: * @return null|int|Node Replacement node (or special return value) Chris@0: */ Chris@0: public function enterNode(Node $node); Chris@0: Chris@0: /** Chris@0: * Called when leaving a node. Chris@0: * Chris@0: * Return value semantics: Chris@0: * * null Chris@0: * => $node stays as-is Chris@0: * * NodeTraverser::REMOVE_NODE Chris@0: * => $node is removed from the parent array Chris@0: * * NodeTraverser::STOP_TRAVERSAL Chris@0: * => Traversal is aborted. $node stays as-is Chris@0: * * array (of Nodes) Chris@0: * => The return value is merged into the parent array (at the position of the $node) Chris@0: * * otherwise Chris@0: * => $node is set to the return value Chris@0: * Chris@0: * @param Node $node Node Chris@0: * Chris@13: * @return null|int|Node|Node[] Replacement node (or special return value) Chris@0: */ Chris@0: public function leaveNode(Node $node); Chris@0: Chris@0: /** Chris@0: * Called once after traversal. Chris@0: * Chris@0: * Return value semantics: Chris@0: * * null: $nodes stays as-is Chris@0: * * otherwise: $nodes is set to the return value Chris@0: * Chris@0: * @param Node[] $nodes Array of nodes Chris@0: * Chris@0: * @return null|Node[] Array of nodes Chris@0: */ Chris@0: public function afterTraverse(array $nodes); Chris@13: }