NodeTraverserInterface.php 598 B

1234567891011121314151617181920212223242526
  1. <?php declare(strict_types=1);
  2. namespace PhpParser;
  3. interface NodeTraverserInterface {
  4. /**
  5. * Adds a visitor.
  6. *
  7. * @param NodeVisitor $visitor Visitor to add
  8. */
  9. public function addVisitor(NodeVisitor $visitor): void;
  10. /**
  11. * Removes an added visitor.
  12. */
  13. public function removeVisitor(NodeVisitor $visitor): void;
  14. /**
  15. * Traverses an array of nodes using the registered visitors.
  16. *
  17. * @param Node[] $nodes Array of nodes
  18. *
  19. * @return Node[] Traversed array of nodes
  20. */
  21. public function traverse(array $nodes): array;
  22. }