1 | <?php |
||
31 | final class VisitorContainer extends Visitor |
||
32 | { |
||
33 | use ErrorAwareTrait; |
||
34 | |||
35 | /** |
||
36 | * @var VisitorInterface[] Contained visitors |
||
37 | */ |
||
38 | private $visitors = []; |
||
39 | |||
40 | /** |
||
41 | * Get contained visitors |
||
42 | * |
||
43 | * @return VisitorInterface[] |
||
44 | */ |
||
45 | public function getVisitors(): array |
||
49 | |||
50 | /** |
||
51 | * Add a visitor to container |
||
52 | */ |
||
53 | public function addVisitor(VisitorInterface $visitor): void |
||
57 | |||
58 | /** |
||
59 | * Delegate visit before to registered visitors |
||
60 | */ |
||
61 | public function visitBefore(Node $node): void |
||
69 | |||
70 | /** |
||
71 | * Delegate visit after to registered visitors |
||
72 | */ |
||
73 | public function visitAfter(Node $node): void |
||
81 | |||
82 | /** |
||
83 | * Reset the error container before a file node |
||
84 | */ |
||
85 | public function beforeAutogiroFile(): void |
||
89 | |||
90 | /** |
||
91 | * Throw exception if there are errors after iteration |
||
92 | */ |
||
93 | public function afterAutogiroFile(): void |
||
99 | } |
||
100 |