1 | <?php |
||
12 | class AnonymousClassReplacer extends NodeVisitorAbstract |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $anonymousClassNodes = []; |
||
18 | |||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | public function leaveNode(Node $node) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function afterTraverse(array $nodes) |
||
66 | |||
67 | /** |
||
68 | * Find the index of the first statement that is not a declare, use or namespace statement. |
||
69 | * |
||
70 | * @param array $statements |
||
71 | * |
||
72 | * @return int |
||
73 | * |
||
74 | * @throws \Spatie\Php7to5\Exceptions\InvalidPhpCode |
||
75 | */ |
||
76 | protected function getAnonymousClassHookIndex(array $statements) |
||
96 | |||
97 | /** |
||
98 | * @param array $nodes |
||
99 | * @param $hookIndex |
||
100 | * @param $anonymousClassStatements |
||
101 | * |
||
102 | * @return array |
||
103 | */ |
||
104 | protected function moveAnonymousClassesToHook(array $nodes, $hookIndex, $anonymousClassStatements) |
||
111 | } |
||
112 |