| Conditions | 5 |
| Paths | 4 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function invoke($node, NodeInterface $parent): void |
||
| 28 | { |
||
| 29 | if (! $node instanceof Node\Stmt\Use_ || ! $parent instanceof PhpFileModelInterface) { |
||
| 30 | throw new Exception('UseNodeParser is made to parse a use node'); |
||
| 31 | } |
||
| 32 | |||
| 33 | if ($node->type === Node\Stmt\Use_::TYPE_NORMAL) { |
||
| 34 | foreach ($node->uses as $use) { |
||
| 35 | $parent->addUse($use->alias, $use->name->toString()); |
||
| 36 | } |
||
| 40 |