| @@ 42-50 (lines=9) @@ | ||
| 39 | ||
| 40 | public function enterNode(Node $node) |
|
| 41 | { |
|
| 42 | if ($node instanceof Node\Stmt\Namespace_) { |
|
| 43 | if (isset($node->name)) { |
|
| 44 | // Save namespace of this class for later. |
|
| 45 | $this->namespace = implode('\\', $node->name->parts); |
|
| 46 | } |
|
| 47 | $this->useStatements = []; |
|
| 48 | ||
| 49 | return; |
|
| 50 | } |
|
| 51 | ||
| 52 | if ($node instanceof Node\Stmt\UseUse) { |
|
| 53 | $this->useStatements[$node->alias] = implode('\\', $node->name->parts); |
|
| @@ 59-66 (lines=8) @@ | ||
| 56 | ||
| 57 | public function enterNode(Node $node) |
|
| 58 | { |
|
| 59 | if ($node instanceof Node\Stmt\Namespace_) { |
|
| 60 | if (isset($node->name)) { |
|
| 61 | // save the namespace |
|
| 62 | $this->namespace = implode('\\', $node->name->parts); |
|
| 63 | } |
|
| 64 | ||
| 65 | return; |
|
| 66 | } |
|
| 67 | ||
| 68 | if (!$node instanceof Node\Stmt\Class_) { |
|
| 69 | return; |
|