@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | $i = new Injector(); |
| 24 | 24 | |
| 25 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 25 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 26 | 26 | $r = $i->injectDependencies( |
| 27 | 27 | file_get_contents($filename), |
| 28 | 28 | $this->getDefinition( |
@@ -35,16 +35,16 @@ discard block |
||
| 35 | 35 | ) |
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | - $this->assertStringContainsString(Fixtures\Test::class . ';', $r); |
|
| 38 | + $this->assertStringContainsString(Fixtures\Test::class.';', $r); |
|
| 39 | 39 | $this->assertRegExp('/@var Test[\s|\r\n]/', $r); |
| 40 | 40 | $this->assertStringContainsString('@param Test $test', $r); |
| 41 | 41 | |
| 42 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as Test2;', $r); |
|
| 43 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 42 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as Test2;', $r); |
|
| 43 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 44 | 44 | $this->assertRegExp('/@var Test2[\s|\r\n]/', $r); |
| 45 | 45 | $this->assertStringContainsString('@param Test2 $test2', $r); |
| 46 | 46 | |
| 47 | - $this->assertStringContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 47 | + $this->assertStringContainsString(Fixtures\ATest3::class.';', $r); |
|
| 48 | 48 | $this->assertRegExp('/@var ATest3[\s|\r\n]/', $r); |
| 49 | 49 | $this->assertStringContainsString('@param ATest3 $test3', $r); |
| 50 | 50 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public static function assertRegExp(string $pattern, string $string, string $message = ''): void |
| 59 | 59 | { |
| 60 | - if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) { |
|
| 60 | + if (\method_exists(Assert::class, 'assertMatchesRegularExpression')){ |
|
| 61 | 61 | Assert::assertMatchesRegularExpression($pattern, $string, $message); |
| 62 | 62 | |
| 63 | 63 | return; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $i = new Injector(); |
| 75 | 75 | |
| 76 | - $filename = __DIR__ . '/Fixtures/TestClassWithImports.php'; |
|
| 76 | + $filename = __DIR__.'/Fixtures/TestClassWithImports.php'; |
|
| 77 | 77 | $r = $i->injectDependencies( |
| 78 | 78 | file_get_contents($filename), |
| 79 | 79 | $this->getDefinition( |
@@ -86,18 +86,18 @@ discard block |
||
| 86 | 86 | ) |
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | - $this->assertStringContainsString(Fixtures\Test::class . ' as FTest;', $r); |
|
| 90 | - $this->assertStringNotContainsString(Fixtures\Test::class . ';', $r); |
|
| 89 | + $this->assertStringContainsString(Fixtures\Test::class.' as FTest;', $r); |
|
| 90 | + $this->assertStringNotContainsString(Fixtures\Test::class.';', $r); |
|
| 91 | 91 | $this->assertRegExp('/@var FTest[\s|\r\n]/', $r); |
| 92 | 92 | $this->assertStringContainsString('@param FTest $test', $r); |
| 93 | 93 | |
| 94 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as TestAlias;', $r); |
|
| 95 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 94 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as TestAlias;', $r); |
|
| 95 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 96 | 96 | $this->assertRegExp('/@var TestAlias[\s|\r\n]/', $r); |
| 97 | 97 | $this->assertStringContainsString('@param TestAlias $test2', $r); |
| 98 | 98 | |
| 99 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATest;', $r); |
|
| 100 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 99 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATest;', $r); |
|
| 100 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 101 | 101 | $this->assertRegExp('/@var ATest[\s|\r\n]/', $r); |
| 102 | 102 | $this->assertStringContainsString('@param ATest $test3', $r); |
| 103 | 103 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | { |
| 110 | 110 | $i = new Injector(); |
| 111 | 111 | |
| 112 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
| 112 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
| 113 | 113 | $r = $i->injectDependencies( |
| 114 | 114 | file_get_contents($filename), |
| 115 | 115 | $this->getDefinition( |
@@ -122,17 +122,17 @@ discard block |
||
| 122 | 122 | ) |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $this->assertStringContainsString(Fixtures\Test::class . ';', $r); |
|
| 125 | + $this->assertStringContainsString(Fixtures\Test::class.';', $r); |
|
| 126 | 126 | $this->assertRegExp('/@var Test[\s|\r\n]/', $r); |
| 127 | 127 | $this->assertStringContainsString('@param Test $test', $r); |
| 128 | 128 | |
| 129 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as Test2;', $r); |
|
| 130 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 129 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as Test2;', $r); |
|
| 130 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 131 | 131 | $this->assertRegExp('/@var Test2[\s|\r\n]/', $r); |
| 132 | 132 | $this->assertStringContainsString('@param Test2 $test2', $r); |
| 133 | 133 | |
| 134 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATestAlias;', $r); |
|
| 135 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 134 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATestAlias;', $r); |
|
| 135 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 136 | 136 | $this->assertRegExp('/@var ATestAlias[\s|\r\n]/', $r); |
| 137 | 137 | $this->assertStringContainsString('@param ATestAlias $test3', $r); |
| 138 | 138 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $i = new Injector(); |
| 143 | 143 | |
| 144 | - $filename = __DIR__ . '/Fixtures/DuplicatePropertyClass.php'; |
|
| 144 | + $filename = __DIR__.'/Fixtures/DuplicatePropertyClass.php'; |
|
| 145 | 145 | $r = $i->injectDependencies( |
| 146 | 146 | file_get_contents($filename), |
| 147 | 147 | $this->getDefinition( |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | ) |
| 153 | 153 | ); |
| 154 | 154 | |
| 155 | - $this->assertStringContainsString(Fixtures\Test::class . ';', $r); |
|
| 155 | + $this->assertStringContainsString(Fixtures\Test::class.';', $r); |
|
| 156 | 156 | $this->assertMatchesRegularExpression('/@var Test[\s|\r\n]/', $r); |
| 157 | 157 | $this->assertStringContainsString('@param Test $test', $r); |
| 158 | 158 | $this->assertStringContainsString('__construct(Test $test)', $r); |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function __construct($name = null, array $data = [], $dataName = '') |
| 41 | 41 | { |
| 42 | - $this->storage = new Storage($this->dir() . '/Fixtures/'); |
|
| 42 | + $this->storage = new Storage($this->dir().'/Fixtures/'); |
|
| 43 | 43 | parent::__construct($name, $data, $dataName); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function setUp(): void |
| 47 | 47 | { |
| 48 | - if (!\class_exists(Kernel::class)) { |
|
| 48 | + if (!\class_exists(Kernel::class)){ |
|
| 49 | 49 | $this->markTestSkipped('A "spiral/framework" dependency is required to run these tests'); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -56,14 +56,14 @@ discard block |
||
| 56 | 56 | 'cache' => sys_get_temp_dir() |
| 57 | 57 | ], null, false); |
| 58 | 58 | |
| 59 | - foreach (static::STORE as $name) { |
|
| 59 | + foreach (static::STORE as $name){ |
|
| 60 | 60 | $this->storage->store($name); |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function tearDown(): void |
| 65 | 65 | { |
| 66 | - foreach (static::STORE as $name) { |
|
| 66 | + foreach (static::STORE as $name){ |
|
| 67 | 67 | $this->storage->restore($name); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -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,8 @@ |
||
| 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 | + foreach ($node->uses as $use){ |
|
| 32 | 32 | $this->imports[] = [ |
| 33 | 33 | 'name' => implode('\\', $use->name->parts), |
| 34 | 34 | 'alias' => $use->alias->name ?? null, |
@@ -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,16 @@ |
||
| 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 | + foreach ($node->stmts as $stmt){ |
|
| 30 | + if ($stmt instanceof Node\Stmt\ClassMethod && $stmt->name === '__construct'){ |
|
| 31 | 31 | return $stmt; |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | return NodeTraverser::DONT_TRAVERSE_CHILDREN; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - if ($node instanceof Node\Expr\Variable) { |
|
| 37 | + if ($node instanceof Node\Expr\Variable){ |
|
| 38 | 38 | $this->vars[] = $node->name; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -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 | |