@@ -45,7 +45,8 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | public function setUp(): void |
| 47 | 47 | { |
| 48 | - if (!\class_exists(Kernel::class)) { |
|
| 48 | + if (!\class_exists(Kernel::class)) |
|
| 49 | + { |
|
| 49 | 50 | $this->markTestSkipped('A "spiral/framework" dependency is required to run these tests'); |
| 50 | 51 | } |
| 51 | 52 | |
@@ -56,14 +57,16 @@ discard block |
||
| 56 | 57 | 'cache' => sys_get_temp_dir() |
| 57 | 58 | ], null, false); |
| 58 | 59 | |
| 59 | - foreach (static::STORE as $name) { |
|
| 60 | + foreach (static::STORE as $name) |
|
| 61 | + { |
|
| 60 | 62 | $this->storage->store($name); |
| 61 | 63 | } |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | 66 | public function tearDown(): void |
| 65 | 67 | { |
| 66 | - foreach (static::STORE as $name) { |
|
| 68 | + foreach (static::STORE as $name) |
|
| 69 | + { |
|
| 67 | 70 | $this->storage->restore($name); |
| 68 | 71 | } |
| 69 | 72 | } |
@@ -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 | |