NodeTraverserInterface.php 576 B

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