2024-05-07 12:17:25 +02:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace PhpParser;
|
|
|
|
|
|
2024-05-17 12:24:19 +00:00
|
|
|
interface NodeTraverserInterface {
|
2024-05-07 12:17:25 +02:00
|
|
|
/**
|
|
|
|
|
* Adds a visitor.
|
|
|
|
|
*
|
|
|
|
|
* @param NodeVisitor $visitor Visitor to add
|
|
|
|
|
*/
|
2024-05-17 12:24:19 +00:00
|
|
|
public function addVisitor(NodeVisitor $visitor): void;
|
2024-05-07 12:17:25 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes an added visitor.
|
|
|
|
|
*/
|
2024-05-17 12:24:19 +00:00
|
|
|
public function removeVisitor(NodeVisitor $visitor): void;
|
2024-05-07 12:17:25 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Traverses an array of nodes using the registered visitors.
|
|
|
|
|
*
|
|
|
|
|
* @param Node[] $nodes Array of nodes
|
|
|
|
|
*
|
|
|
|
|
* @return Node[] Traversed array of nodes
|
|
|
|
|
*/
|
2024-05-17 12:24:19 +00:00
|
|
|
public function traverse(array $nodes): array;
|
2024-05-07 12:17:25 +02:00
|
|
|
}
|