@@ -27,8 +27,10 @@ |
||
27 | 27 | */ |
28 | 28 | public function enterNode(Node $node) |
29 | 29 | { |
30 | - if ($node instanceof Node\Stmt\Use_) { |
|
31 | - foreach ($node->uses as $use) { |
|
30 | + if ($node instanceof Node\Stmt\Use_) |
|
31 | + { |
|
32 | + foreach ($node->uses as $use) |
|
33 | + { |
|
32 | 34 | $this->imports[] = [ |
33 | 35 | 'name' => implode('\\', $use->name->parts), |
34 | 36 | 'alias' => $use->alias->name ?? null, |
@@ -25,16 +25,20 @@ |
||
25 | 25 | */ |
26 | 26 | public function enterNode(Node $node) |
27 | 27 | { |
28 | - if ($node instanceof Node\Stmt\Class_) { |
|
29 | - foreach ($node->stmts as $stmt) { |
|
30 | - if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct') { |
|
28 | + if ($node instanceof Node\Stmt\Class_) |
|
29 | + { |
|
30 | + foreach ($node->stmts as $stmt) |
|
31 | + { |
|
32 | + if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct') |
|
33 | + { |
|
31 | 34 | return $stmt; |
32 | 35 | } |
33 | 36 | } |
34 | 37 | return NodeTraverser::DONT_TRAVERSE_CHILDREN; |
35 | 38 | } |
36 | 39 | |
37 | - if ($node instanceof Node\Expr\Variable) { |
|
40 | + if ($node instanceof Node\Expr\Variable) |
|
41 | + { |
|
38 | 42 | $this->vars[] = $node->name; |
39 | 43 | } |
40 | 44 |