You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
629 B

3 years ago
  1. <?php declare(strict_types=1);
  2. namespace PhpParser;
  3. interface NodeTraverserInterface
  4. {
  5. /**
  6. * Adds a visitor.
  7. *
  8. * @param NodeVisitor $visitor Visitor to add
  9. */
  10. public function addVisitor(NodeVisitor $visitor);
  11. /**
  12. * Removes an added visitor.
  13. *
  14. * @param NodeVisitor $visitor
  15. */
  16. public 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. public function traverse(array $nodes) : array;
  25. }