| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function parse(Node $nodeToParse, NodeInterface $node): NodeInterface |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * Overriding variable types. |
||
| 27 | * @var Node\Stmt\Use_ $nodeToParse The namespace node to parse. |
||
| 28 | * @var PhpFileModelInterface $node The node which contains this namespace. |
||
| 29 | */ |
||
| 30 | foreach ($nodeToParse->uses as $use) { |
||
|
|
|||
| 31 | if ($use->alias !== null) { |
||
| 32 | $node->addUse($use->alias, $use->name->toString()); |
||
| 33 | } else { |
||
| 34 | $node->addUse($use->name->getLast(), $use->name->toString()); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | return $node; |
||
| 39 | } |
||
| 40 | } |