Copied!
Abstract Interface
Methods
public abstract afterTraverse ( array $nodes )
 

Called once after traversal.

Return value semantics:

  • null: $nodes stays as-is
  • otherwise: $nodes is set to the return value
public abstract beforeTraverse ( array $nodes )
 

Called once before traversal.

Return value semantics:

  • null: $nodes stays as-is
  • otherwise: $nodes is set to the return value
public abstract enterNode ( PhpParser\Node $node )
 

Called when entering a node.

Return value semantics:

  • null
    => $node stays as-is
    
  • NodeTraverser::DONT_TRAVERSE_CHILDREN
    => Children of $node are not traversed. $node stays as-is
    
  • NodeTraverser::STOP_TRAVERSAL
    => Traversal is aborted. $node stays as-is
    
  • otherwise
    => $node is set to the return value
    
public abstract leaveNode ( PhpParser\Node $node )
 

Called when leaving a node.

Return value semantics:

  • null
    => $node stays as-is
    
  • NodeTraverser::REMOVE_NODE
    => $node is removed from the parent array
    
  • NodeTraverser::STOP_TRAVERSAL
    => Traversal is aborted. $node stays as-is
    
  • array (of Nodes)
    => The return value is merged into the parent array (at the position of the $node)
    
  • otherwise
    => $node is set to the return value
    
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only