@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $i = new Injector(); |
| 25 | 25 | |
| 26 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 26 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 27 | 27 | $r = $i->injectDependencies( |
| 28 | 28 | file_get_contents($filename), |
| 29 | 29 | $this->getDefinition($filename, [ |
@@ -33,16 +33,16 @@ discard block |
||
| 33 | 33 | ]) |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | - $this->assertStringContainsString(Fixtures\Test::class . ';', $r); |
|
| 36 | + $this->assertStringContainsString(Fixtures\Test::class.';', $r); |
|
| 37 | 37 | $this->assertRegExp('/@var Test[\s|\r\n]/', $r); |
| 38 | 38 | $this->assertStringContainsString('@param Test $test', $r); |
| 39 | 39 | |
| 40 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as Test2;', $r); |
|
| 41 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 40 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as Test2;', $r); |
|
| 41 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 42 | 42 | $this->assertRegExp('/@var Test2[\s|\r\n]/', $r); |
| 43 | 43 | $this->assertStringContainsString('@param Test2 $test2', $r); |
| 44 | 44 | |
| 45 | - $this->assertStringContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 45 | + $this->assertStringContainsString(Fixtures\ATest3::class.';', $r); |
|
| 46 | 46 | $this->assertRegExp('/@var ATest3[\s|\r\n]/', $r); |
| 47 | 47 | $this->assertStringContainsString('@param ATest3 $test3', $r); |
| 48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public static function assertRegExp(string $pattern, string $string, string $message = ''): void |
| 57 | 57 | { |
| 58 | - if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) { |
|
| 58 | + if (\method_exists(Assert::class, 'assertMatchesRegularExpression')){ |
|
| 59 | 59 | Assert::assertMatchesRegularExpression($pattern, $string, $message); |
| 60 | 60 | |
| 61 | 61 | return; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $i = new Injector(); |
| 92 | 92 | |
| 93 | - $filename = __DIR__ . '/Fixtures/TestClassWithImports.php'; |
|
| 93 | + $filename = __DIR__.'/Fixtures/TestClassWithImports.php'; |
|
| 94 | 94 | $r = $i->injectDependencies( |
| 95 | 95 | file_get_contents($filename), |
| 96 | 96 | $this->getDefinition($filename, [ |
@@ -100,18 +100,18 @@ discard block |
||
| 100 | 100 | ]) |
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | - $this->assertStringContainsString(Fixtures\Test::class . ' as FTest;', $r); |
|
| 104 | - $this->assertStringNotContainsString(Fixtures\Test::class . ';', $r); |
|
| 103 | + $this->assertStringContainsString(Fixtures\Test::class.' as FTest;', $r); |
|
| 104 | + $this->assertStringNotContainsString(Fixtures\Test::class.';', $r); |
|
| 105 | 105 | $this->assertRegExp('/@var FTest[\s|\r\n]/', $r); |
| 106 | 106 | $this->assertStringContainsString('@param FTest $test', $r); |
| 107 | 107 | |
| 108 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as TestAlias;', $r); |
|
| 109 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 108 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as TestAlias;', $r); |
|
| 109 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 110 | 110 | $this->assertRegExp('/@var TestAlias[\s|\r\n]/', $r); |
| 111 | 111 | $this->assertStringContainsString('@param TestAlias $test2', $r); |
| 112 | 112 | |
| 113 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATest;', $r); |
|
| 114 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 113 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATest;', $r); |
|
| 114 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 115 | 115 | $this->assertRegExp('/@var ATest[\s|\r\n]/', $r); |
| 116 | 116 | $this->assertStringContainsString('@param ATest $test3', $r); |
| 117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | $i = new Injector(); |
| 125 | 125 | |
| 126 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
| 126 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
| 127 | 127 | $r = $i->injectDependencies( |
| 128 | 128 | file_get_contents($filename), |
| 129 | 129 | $this->getDefinition($filename, [ |
@@ -133,17 +133,17 @@ discard block |
||
| 133 | 133 | ]) |
| 134 | 134 | ); |
| 135 | 135 | |
| 136 | - $this->assertStringContainsString(Fixtures\Test::class . ';', $r); |
|
| 136 | + $this->assertStringContainsString(Fixtures\Test::class.';', $r); |
|
| 137 | 137 | $this->assertRegExp('/@var Test[\s|\r\n]/', $r); |
| 138 | 138 | $this->assertStringContainsString('@param Test $test', $r); |
| 139 | 139 | |
| 140 | - $this->assertStringContainsString(Fixtures\SubFolder\Test::class . ' as Test2;', $r); |
|
| 141 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class . ';', $r); |
|
| 140 | + $this->assertStringContainsString(Fixtures\SubFolder\Test::class.' as Test2;', $r); |
|
| 141 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Test::class.';', $r); |
|
| 142 | 142 | $this->assertRegExp('/@var Test2[\s|\r\n]/', $r); |
| 143 | 143 | $this->assertStringContainsString('@param Test2 $test2', $r); |
| 144 | 144 | |
| 145 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATestAlias;', $r); |
|
| 146 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 145 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATestAlias;', $r); |
|
| 146 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 147 | 147 | $this->assertRegExp('/@var ATestAlias[\s|\r\n]/', $r); |
| 148 | 148 | $this->assertStringContainsString('@param ATestAlias $test3', $r); |
| 149 | 149 | } |
@@ -55,7 +55,8 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | public static function assertRegExp(string $pattern, string $string, string $message = ''): void |
| 57 | 57 | { |
| 58 | - if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) { |
|
| 58 | + if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) |
|
| 59 | + { |
|
| 59 | 60 | Assert::assertMatchesRegularExpression($pattern, $string, $message); |
| 60 | 61 | |
| 61 | 62 | return; |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | DirectoriesInterface::class, |
| 50 | 50 | new Directories( |
| 51 | 51 | [ |
| 52 | - 'app' => __DIR__ . '/fixtures', |
|
| 53 | - 'cache' => __DIR__ . '/cache' |
|
| 52 | + 'app' => __DIR__.'/fixtures', |
|
| 53 | + 'cache' => __DIR__.'/cache' |
|
| 54 | 54 | ] |
| 55 | 55 | ) |
| 56 | 56 | ); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $this->container->bind( |
| 60 | 60 | ConfiguratorInterface::class, |
| 61 | 61 | new ConfigManager( |
| 62 | - new DirectoryLoader(__DIR__ . '/config/', $this->container), |
|
| 62 | + new DirectoryLoader(__DIR__.'/config/', $this->container), |
|
| 63 | 63 | true |
| 64 | 64 | ) |
| 65 | 65 | ); |
@@ -35,13 +35,13 @@ |
||
| 35 | 35 | |
| 36 | 36 | public function testCache(): void |
| 37 | 37 | { |
| 38 | - $this->assertCount(0, $this->files->getFiles(__DIR__ . '/cache/', '*.php')); |
|
| 38 | + $this->assertCount(0, $this->files->getFiles(__DIR__.'/cache/', '*.php')); |
|
| 39 | 39 | |
| 40 | 40 | $s = $this->getStempler(); |
| 41 | 41 | $this->assertSame('test', $s->get('test', new ViewContext())->render([])); |
| 42 | - $this->assertCount(2, $this->files->getFiles(__DIR__ . '/cache/', '*.php')); |
|
| 42 | + $this->assertCount(2, $this->files->getFiles(__DIR__.'/cache/', '*.php')); |
|
| 43 | 43 | |
| 44 | 44 | $s->reset('test', new ViewContext()); |
| 45 | - $this->assertCount(0, $this->files->getFiles(__DIR__ . '/../cache/', '*.php')); |
|
| 45 | + $this->assertCount(0, $this->files->getFiles(__DIR__.'/../cache/', '*.php')); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $s = $this->getStempler(); |
| 59 | 59 | |
| 60 | - try { |
|
| 60 | + try{ |
|
| 61 | 61 | $s->get('echo', new ViewContext())->render(); |
| 62 | - } catch (RenderException $e) { |
|
| 62 | + }catch (RenderException $e){ |
|
| 63 | 63 | $t = $e->getUserTrace()[0]; |
| 64 | 64 | |
| 65 | 65 | $this->assertSame(2, $t['line']); |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $s = $this->getStempler(); |
| 73 | 73 | |
| 74 | - try { |
|
| 74 | + try{ |
|
| 75 | 75 | $s->get('other:echo-in', new ViewContext())->render(); |
| 76 | - } catch (RenderException $e) { |
|
| 76 | + }catch (RenderException $e){ |
|
| 77 | 77 | $t = $e->getUserTrace(); |
| 78 | 78 | $this->assertCount(2, $t); |
| 79 | 79 | |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $twig = $this->getStempler(); |
| 91 | 91 | |
| 92 | - try { |
|
| 92 | + try{ |
|
| 93 | 93 | $twig->get('other:bad', new ViewContext()); |
| 94 | - } catch (CompileException $e) { |
|
| 94 | + }catch (CompileException $e){ |
|
| 95 | 95 | $this->assertStringContainsString('bad.dark.php', $e->getFile()); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -57,9 +57,12 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $s = $this->getStempler(); |
| 59 | 59 | |
| 60 | - try { |
|
| 60 | + try |
|
| 61 | + { |
|
| 61 | 62 | $s->get('echo', new ViewContext())->render(); |
| 62 | - } catch (RenderException $e) { |
|
| 63 | + } |
|
| 64 | + catch (RenderException $e) |
|
| 65 | + { |
|
| 63 | 66 | $t = $e->getUserTrace()[0]; |
| 64 | 67 | |
| 65 | 68 | $this->assertSame(2, $t['line']); |
@@ -71,9 +74,12 @@ discard block |
||
| 71 | 74 | { |
| 72 | 75 | $s = $this->getStempler(); |
| 73 | 76 | |
| 74 | - try { |
|
| 77 | + try |
|
| 78 | + { |
|
| 75 | 79 | $s->get('other:echo-in', new ViewContext())->render(); |
| 76 | - } catch (RenderException $e) { |
|
| 80 | + } |
|
| 81 | + catch (RenderException $e) |
|
| 82 | + { |
|
| 77 | 83 | $t = $e->getUserTrace(); |
| 78 | 84 | $this->assertCount(2, $t); |
| 79 | 85 | |
@@ -89,9 +95,12 @@ discard block |
||
| 89 | 95 | { |
| 90 | 96 | $twig = $this->getStempler(); |
| 91 | 97 | |
| 92 | - try { |
|
| 98 | + try |
|
| 99 | + { |
|
| 93 | 100 | $twig->get('other:bad', new ViewContext()); |
| 94 | - } catch (CompileException $e) { |
|
| 101 | + } |
|
| 102 | + catch (CompileException $e) |
|
| 103 | + { |
|
| 95 | 104 | $this->assertStringContainsString('bad.dark.php', $e->getFile()); |
| 96 | 105 | } |
| 97 | 106 | } |