| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 18 | public function __invoke(Traversable $ASTs) : array |
||
| 19 | { |
||
| 20 | // note: dependency injection is not really feasible for these two, as they need to co-exist in parallel |
||
| 21 | $traverser = new NodeTraverser(); |
||
| 22 | |||
| 23 | $traverser->addVisitor(new NameResolver()); |
||
| 24 | $traverser->addVisitor($collector = new DefinedSymbolCollector()); |
||
| 25 | |||
| 26 | $astSymbols = []; |
||
| 27 | |||
| 28 | foreach ($ASTs as $astRoot) { |
||
| 29 | $traverser->traverse($astRoot); |
||
| 30 | |||
| 31 | $astSymbols[] = $collector->getDefinedSymbols(); |
||
| 32 | } |
||
| 33 | |||
| 34 | return array_values(array_unique(array_merge([], ...$astSymbols))); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |