@@ -10,8 +10,8 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @see https://github.com/symplify/symplify/issues/2061 |
| 12 | 12 | */ |
| 13 | -\register_shutdown_function(static function () { |
|
| 14 | - $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true); |
|
| 13 | +\register_shutdown_function(static function (){ |
|
| 14 | + $dest = \json_decode(\file_get_contents(__DIR__.'/composer.json'), true); |
|
| 15 | 15 | |
| 16 | 16 | $result = [ |
| 17 | 17 | 'name' => 'spiral/framework', |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | $json = \json_encode($result, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES); |
| 48 | 48 | |
| 49 | - \file_put_contents(__DIR__ . '/composer.json', $json . "\n"); |
|
| 49 | + \file_put_contents(__DIR__.'/composer.json', $json."\n"); |
|
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | 52 | |
@@ -10,7 +10,8 @@ |
||
| 10 | 10 | * |
| 11 | 11 | * @see https://github.com/symplify/symplify/issues/2061 |
| 12 | 12 | */ |
| 13 | -\register_shutdown_function(static function () { |
|
| 13 | +\register_shutdown_function(static function () |
|
| 14 | +{ |
|
| 14 | 15 | $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true); |
| 15 | 16 | |
| 16 | 17 | $result = [ |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | class StreamsTest extends TestCase |
| 19 | 19 | { |
| 20 | - private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures'; |
|
| 20 | + private const FIXTURE_DIRECTORY = __DIR__.'/fixtures'; |
|
| 21 | 21 | |
| 22 | 22 | public function setUp(): void |
| 23 | 23 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $this->assertSame(strlen('sample text'), filesize($filename)); |
| 43 | 43 | $this->assertSame(md5('sample text'), md5_file($filename)); |
| 44 | 44 | |
| 45 | - $newFilename = self::FIXTURE_DIRECTORY . '/test.txt'; |
|
| 45 | + $newFilename = self::FIXTURE_DIRECTORY.'/test.txt'; |
|
| 46 | 46 | copy($filename, $newFilename); |
| 47 | 47 | |
| 48 | 48 | $this->assertFileExists($newFilename); |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function testException() |
| 85 | 85 | { |
| 86 | - try { |
|
| 86 | + try{ |
|
| 87 | 87 | fopen('spiral://non-exists', 'rb'); |
| 88 | - } catch (\Throwable $e) { |
|
| 88 | + }catch (\Throwable $e){ |
|
| 89 | 89 | $this->assertStringContainsString('failed to open stream', $e->getMessage()); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - try { |
|
| 92 | + try{ |
|
| 93 | 93 | filemtime('spiral://non-exists'); |
| 94 | - } catch (\Throwable $e) { |
|
| 94 | + }catch (\Throwable $e){ |
|
| 95 | 95 | $this->assertStringContainsString('stat failed', $e->getMessage()); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function testExceptionPHP8() |
| 103 | 103 | { |
| 104 | - try { |
|
| 104 | + try{ |
|
| 105 | 105 | fopen('spiral://non-exists', 'rb'); |
| 106 | - } catch (\Throwable $e) { |
|
| 106 | + }catch (\Throwable $e){ |
|
| 107 | 107 | $this->assertStringContainsString('Failed to open stream', $e->getMessage()); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - try { |
|
| 110 | + try{ |
|
| 111 | 111 | filemtime('spiral://non-exists'); |
| 112 | - } catch (\Throwable $e) { |
|
| 112 | + }catch (\Throwable $e){ |
|
| 113 | 113 | $this->assertStringContainsString('stat failed', $e->getMessage()); |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -83,15 +83,21 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function testException() |
| 85 | 85 | { |
| 86 | - try { |
|
| 86 | + try |
|
| 87 | + { |
|
| 87 | 88 | fopen('spiral://non-exists', 'rb'); |
| 88 | - } catch (\Throwable $e) { |
|
| 89 | + } |
|
| 90 | + catch (\Throwable $e) |
|
| 91 | + { |
|
| 89 | 92 | $this->assertStringContainsString('failed to open stream', $e->getMessage()); |
| 90 | 93 | } |
| 91 | 94 | |
| 92 | - try { |
|
| 95 | + try |
|
| 96 | + { |
|
| 93 | 97 | filemtime('spiral://non-exists'); |
| 94 | - } catch (\Throwable $e) { |
|
| 98 | + } |
|
| 99 | + catch (\Throwable $e) |
|
| 100 | + { |
|
| 95 | 101 | $this->assertStringContainsString('stat failed', $e->getMessage()); |
| 96 | 102 | } |
| 97 | 103 | } |
@@ -101,15 +107,21 @@ discard block |
||
| 101 | 107 | */ |
| 102 | 108 | public function testExceptionPHP8() |
| 103 | 109 | { |
| 104 | - try { |
|
| 110 | + try |
|
| 111 | + { |
|
| 105 | 112 | fopen('spiral://non-exists', 'rb'); |
| 106 | - } catch (\Throwable $e) { |
|
| 113 | + } |
|
| 114 | + catch (\Throwable $e) |
|
| 115 | + { |
|
| 107 | 116 | $this->assertStringContainsString('Failed to open stream', $e->getMessage()); |
| 108 | 117 | } |
| 109 | 118 | |
| 110 | - try { |
|
| 119 | + try |
|
| 120 | + { |
|
| 111 | 121 | filemtime('spiral://non-exists'); |
| 112 | - } catch (\Throwable $e) { |
|
| 122 | + } |
|
| 123 | + catch (\Throwable $e) |
|
| 124 | + { |
|
| 113 | 125 | $this->assertStringContainsString('stat failed', $e->getMessage()); |
| 114 | 126 | } |
| 115 | 127 | } |
@@ -51,11 +51,11 @@ |
||
| 51 | 51 | public static function unpack(array $payload): MessageInterface |
| 52 | 52 | { |
| 53 | 53 | $message = new Message($payload['subject'], $payload['to'], $payload['data']); |
| 54 | - if ($payload['from'] !== null) { |
|
| 54 | + if ($payload['from'] !== null){ |
|
| 55 | 55 | $message->setFrom($payload['from']); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ($payload['replyTo'] !== null) { |
|
| 58 | + if ($payload['replyTo'] !== null){ |
|
| 59 | 59 | $message->setReplyTo($payload['replyTo']); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -51,11 +51,13 @@ |
||
| 51 | 51 | public static function unpack(array $payload): MessageInterface |
| 52 | 52 | { |
| 53 | 53 | $message = new Message($payload['subject'], $payload['to'], $payload['data']); |
| 54 | - if ($payload['from'] !== null) { |
|
| 54 | + if ($payload['from'] !== null) |
|
| 55 | + { |
|
| 55 | 56 | $message->setFrom($payload['from']); |
| 56 | 57 | } |
| 57 | 58 | |
| 58 | - if ($payload['replyTo'] !== null) { |
|
| 59 | + if ($payload['replyTo'] !== null) |
|
| 60 | + { |
|
| 59 | 61 | $message->setReplyTo($payload['replyTo']); |
| 60 | 62 | } |
| 61 | 63 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $source = file_get_contents($filename); |
| 30 | 30 | $this->assertStringContainsString('use PrototypeTrait;', $source); |
| 31 | 31 | |
| 32 | - try { |
|
| 32 | + try{ |
|
| 33 | 33 | $this->app->bindApp(); |
| 34 | 34 | |
| 35 | 35 | $inp = new ArrayInput(['--remove' => true]); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->app->get(Console::class)->run('prototype:inject', $inp, $out); |
| 38 | 38 | |
| 39 | 39 | $this->assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename)); |
| 40 | - } finally { |
|
| 40 | + }finally{ |
|
| 41 | 41 | file_put_contents($filename, $source); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -29,7 +29,8 @@ discard block |
||
| 29 | 29 | $source = file_get_contents($filename); |
| 30 | 30 | $this->assertStringContainsString('use PrototypeTrait;', $source); |
| 31 | 31 | |
| 32 | - try { |
|
| 32 | + try |
|
| 33 | + { |
|
| 33 | 34 | $this->app->bindApp(); |
| 34 | 35 | |
| 35 | 36 | $inp = new ArrayInput(['--remove' => true]); |
@@ -37,7 +38,9 @@ discard block |
||
| 37 | 38 | $this->app->get(Console::class)->run('prototype:inject', $inp, $out); |
| 38 | 39 | |
| 39 | 40 | $this->assertStringNotContainsString('use PrototypeTrait;', file_get_contents($filename)); |
| 40 | - } finally { |
|
| 41 | + } |
|
| 42 | + finally |
|
| 43 | + { |
|
| 41 | 44 | file_put_contents($filename, $source); |
| 42 | 45 | } |
| 43 | 46 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | $_msg_->subject(\Spiral\SendIt\Renderer\ViewRenderer::escapeSubject(inject('subject'))); |
| 9 | 9 | |
| 10 | -if (injected('from')) { |
|
| 10 | +if (injected('from')){ |
|
| 11 | 11 | $_msg_->from(\Symfony\Component\Mime\Address::create(inject('from'))); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -19,13 +19,13 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | ob_start(); ?>${html}<?php $_html_ = ob_get_clean(); |
| 21 | 21 | |
| 22 | -if (!empty($_html_)) { |
|
| 22 | +if (!empty($_html_)){ |
|
| 23 | 23 | $_msg_->html($_html_); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | ob_start(); ?>${text}<?php $_text_ = ob_get_clean(); |
| 27 | 27 | |
| 28 | -if (!empty($_text_)) { |
|
| 28 | +if (!empty($_text_)){ |
|
| 29 | 29 | $_msg_->text($_text_); |
| 30 | 30 | } |
| 31 | 31 | ?> |
@@ -7,7 +7,8 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | $_msg_->subject(\Spiral\SendIt\Renderer\ViewRenderer::escapeSubject(inject('subject'))); |
| 9 | 9 | |
| 10 | -if (injected('from')) { |
|
| 10 | +if (injected('from')) |
|
| 11 | +{ |
|
| 11 | 12 | $_msg_->from(\Symfony\Component\Mime\Address::create(inject('from'))); |
| 12 | 13 | } |
| 13 | 14 | |
@@ -19,13 +20,15 @@ discard block |
||
| 19 | 20 | |
| 20 | 21 | ob_start(); ?>${html}<?php $_html_ = ob_get_clean(); |
| 21 | 22 | |
| 22 | -if (!empty($_html_)) { |
|
| 23 | +if (!empty($_html_)) |
|
| 24 | +{ |
|
| 23 | 25 | $_msg_->html($_html_); |
| 24 | 26 | } |
| 25 | 27 | |
| 26 | 28 | ob_start(); ?>${text}<?php $_text_ = ob_get_clean(); |
| 27 | 29 | |
| 28 | -if (!empty($_text_)) { |
|
| 30 | +if (!empty($_text_)) |
|
| 31 | +{ |
|
| 29 | 32 | $_msg_->text($_text_); |
| 30 | 33 | } |
| 31 | 34 | ?> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function assertRegExp(string $pattern, string $string, string $message = ''): void |
| 21 | 21 | { |
| 22 | - if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) { |
|
| 22 | + if (\method_exists(Assert::class, 'assertMatchesRegularExpression')){ |
|
| 23 | 23 | Assert::assertMatchesRegularExpression($pattern, $string, $message); |
| 24 | 24 | |
| 25 | 25 | return; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public static function assertNotRegExp(string $pattern, string $string, string $message = ''): void |
| 37 | 37 | { |
| 38 | - if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression')) { |
|
| 38 | + if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression')){ |
|
| 39 | 39 | Assert::assertDoesNotMatchRegularExpression($pattern, $string, $message); |
| 40 | 40 | |
| 41 | 41 | return; |
@@ -19,7 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function assertRegExp(string $pattern, string $string, string $message = ''): void |
| 21 | 21 | { |
| 22 | - if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) { |
|
| 22 | + if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) |
|
| 23 | + { |
|
| 23 | 24 | Assert::assertMatchesRegularExpression($pattern, $string, $message); |
| 24 | 25 | |
| 25 | 26 | return; |
@@ -35,7 +36,8 @@ discard block |
||
| 35 | 36 | */ |
| 36 | 37 | public static function assertNotRegExp(string $pattern, string $string, string $message = ''): void |
| 37 | 38 | { |
| 38 | - if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression')) { |
|
| 39 | + if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression')) |
|
| 40 | + { |
|
| 39 | 41 | Assert::assertDoesNotMatchRegularExpression($pattern, $string, $message); |
| 40 | 42 | |
| 41 | 43 | return; |
@@ -27,7 +27,8 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function setUp(): void |
| 29 | 29 | { |
| 30 | - if ((string)ini_get('zend.assertions') === 1) { |
|
| 30 | + if ((string)ini_get('zend.assertions') === 1) |
|
| 31 | + { |
|
| 31 | 32 | ini_set('zend.assertions', 0); |
| 32 | 33 | } |
| 33 | 34 | } |
@@ -75,15 +76,21 @@ discard block |
||
| 75 | 76 | $noPhpDoc |
| 76 | 77 | ); |
| 77 | 78 | |
| 78 | - if ($expectedTypedProperty) { |
|
| 79 | + if ($expectedTypedProperty) |
|
| 80 | + { |
|
| 79 | 81 | $this->assertStringContainsString('private TestClass $testClass;', $printed); |
| 80 | - } else { |
|
| 82 | + } |
|
| 83 | + else |
|
| 84 | + { |
|
| 81 | 85 | $this->assertStringNotContainsString('private TestClass $testClass;', $printed); |
| 82 | 86 | } |
| 83 | 87 | |
| 84 | - if ($expectedPhpDoc) { |
|
| 88 | + if ($expectedPhpDoc) |
|
| 89 | + { |
|
| 85 | 90 | $this->assertRegExp('/@var TestClass[\s|\r\n]/', $printed); |
| 86 | - } else { |
|
| 91 | + } |
|
| 92 | + else |
|
| 93 | + { |
|
| 87 | 94 | $this->assertNotRegExp('/@var TestClass[\s|\r\n]/', $printed); |
| 88 | 95 | } |
| 89 | 96 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function setUp(): void |
| 29 | 29 | { |
| 30 | - if ((string)ini_get('zend.assertions') === 1) { |
|
| 30 | + if ((string)ini_get('zend.assertions') === 1){ |
|
| 31 | 31 | ini_set('zend.assertions', 0); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | $i = new Injector(); |
| 42 | 42 | |
| 43 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 43 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 44 | 44 | $printed = $i->injectDependencies( |
| 45 | 45 | file_get_contents($filename), |
| 46 | 46 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | ): void { |
| 67 | 67 | $i = new Injector(); |
| 68 | 68 | |
| 69 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 69 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 70 | 70 | $printed = $i->injectDependencies( |
| 71 | 71 | file_get_contents($filename), |
| 72 | 72 | $this->getDefinition($filename, ['testClass' => TestClass::class]), |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | $noPhpDoc |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | - if ($expectedTypedProperty) { |
|
| 78 | + if ($expectedTypedProperty){ |
|
| 79 | 79 | $this->assertStringContainsString('private TestClass $testClass;', $printed); |
| 80 | - } else { |
|
| 80 | + }else{ |
|
| 81 | 81 | $this->assertStringNotContainsString('private TestClass $testClass;', $printed); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if ($expectedPhpDoc) { |
|
| 84 | + if ($expectedPhpDoc){ |
|
| 85 | 85 | $this->assertRegExp('/@var TestClass[\s|\r\n]/', $printed); |
| 86 | - } else { |
|
| 86 | + }else{ |
|
| 87 | 87 | $this->assertNotRegExp('/@var TestClass[\s|\r\n]/', $printed); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | { |
| 107 | 107 | $i = new Injector(); |
| 108 | 108 | |
| 109 | - $filename = __DIR__ . '/Fixtures/TestEmptyClass.php'; |
|
| 109 | + $filename = __DIR__.'/Fixtures/TestEmptyClass.php'; |
|
| 110 | 110 | $content = file_get_contents($filename); |
| 111 | 111 | $printed = $i->injectDependencies( |
| 112 | 112 | file_get_contents($filename), |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $i = new Injector(); |
| 126 | 126 | |
| 127 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 127 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 128 | 128 | $r = $i->injectDependencies( |
| 129 | 129 | file_get_contents($filename), |
| 130 | 130 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $i = new Injector(); |
| 151 | 151 | |
| 152 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
| 152 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
| 153 | 153 | $r = $i->injectDependencies( |
| 154 | 154 | file_get_contents($filename), |
| 155 | 155 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | $i = new Injector(); |
| 169 | 169 | |
| 170 | - $filename = __DIR__ . '/Fixtures/ChildWithConstructorClass.php'; |
|
| 170 | + $filename = __DIR__.'/Fixtures/ChildWithConstructorClass.php'; |
|
| 171 | 171 | $r = $i->injectDependencies( |
| 172 | 172 | file_get_contents($filename), |
| 173 | 173 | $this->getDefinition($filename, ['testClass' => TestClass::class]) |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function testModifyConstructor(): void |
| 185 | 185 | { |
| 186 | - $filename = __DIR__ . '/Fixtures/WithConstructor.php'; |
|
| 186 | + $filename = __DIR__.'/Fixtures/WithConstructor.php'; |
|
| 187 | 187 | $extractor = new Traverse\Extractor(); |
| 188 | 188 | |
| 189 | 189 | $parameters = $extractor->extractFromFilename($filename); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function testPriorOptionalConstructorParameters(): void |
| 211 | 211 | { |
| 212 | - $filename = __DIR__ . '/Fixtures/OptionalConstructorArgsClass.php'; |
|
| 212 | + $filename = __DIR__.'/Fixtures/OptionalConstructorArgsClass.php'; |
|
| 213 | 213 | $extractor = new Traverse\Extractor(); |
| 214 | 214 | |
| 215 | 215 | $parameters = $extractor->extractFromFilename($filename); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | { |
| 241 | 241 | $i = new Injector(); |
| 242 | 242 | |
| 243 | - $filename = __DIR__ . '/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
| 243 | + $filename = __DIR__.'/ClassNode/ConflictResolver/Fixtures/ChildClass.php'; |
|
| 244 | 244 | $printed = $i->injectDependencies( |
| 245 | 245 | file_get_contents($filename), |
| 246 | 246 | $this->getDefinition( |
@@ -45,9 +45,12 @@ discard block |
||
| 45 | 45 | $classFilename = (new \ReflectionClass($class))->getFileName(); |
| 46 | 46 | |
| 47 | 47 | // looking for proper view error location |
| 48 | - if ($e->getFile() !== $classFilename) { |
|
| 49 | - foreach ($e->getTrace() as $trace) { |
|
| 50 | - if (isset($trace['file']) && $trace['file'] === $classFilename) { |
|
| 48 | + if ($e->getFile() !== $classFilename) |
|
| 49 | + { |
|
| 50 | + foreach ($e->getTrace() as $trace) |
|
| 51 | + { |
|
| 52 | + if (isset($trace['file']) && $trace['file'] === $classFilename) |
|
| 53 | + { |
|
| 51 | 54 | $line = $trace['line']; |
| 52 | 55 | break; |
| 53 | 56 | } |
@@ -55,7 +58,8 @@ discard block |
||
| 55 | 58 | } |
| 56 | 59 | |
| 57 | 60 | $userStack = []; |
| 58 | - foreach ($this->sourcemap->getStack($line - $this->lineOffset) as $stack) { |
|
| 61 | + foreach ($this->sourcemap->getStack($line - $this->lineOffset) as $stack) |
|
| 62 | + { |
|
| 59 | 63 | $userStack[] = [ |
| 60 | 64 | 'file' => $stack['file'], |
| 61 | 65 | 'line' => $stack['line'], |
@@ -65,7 +69,8 @@ discard block |
||
| 65 | 69 | 'args' => [$data], |
| 66 | 70 | ]; |
| 67 | 71 | |
| 68 | - if ($stack['file'] === $filename) { |
|
| 72 | + if ($stack['file'] === $filename) |
|
| 73 | + { |
|
| 69 | 74 | // no need to jump over root template |
| 70 | 75 | break; |
| 71 | 76 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public function __construct( |
| 13 | 13 | private readonly SourceMap $sourcemap, |
| 14 | 14 | private readonly int $lineOffset |
| 15 | - ) { |
|
| 15 | + ){ |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | public function mapException(\Throwable $e, string $class, string $filename, array $data): \Throwable |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | $classFilename = (new \ReflectionClass($class))->getFileName(); |
| 22 | 22 | |
| 23 | 23 | // looking for proper view error location |
| 24 | - if ($e->getFile() !== $classFilename) { |
|
| 25 | - foreach ($e->getTrace() as $trace) { |
|
| 26 | - if (isset($trace['file']) && $trace['file'] === $classFilename) { |
|
| 24 | + if ($e->getFile() !== $classFilename){ |
|
| 25 | + foreach ($e->getTrace() as $trace){ |
|
| 26 | + if (isset($trace['file']) && $trace['file'] === $classFilename){ |
|
| 27 | 27 | $line = $trace['line']; |
| 28 | 28 | break; |
| 29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $userStack = []; |
| 34 | - foreach ($this->sourcemap->getStack($line - $this->lineOffset) as $stack) { |
|
| 34 | + foreach ($this->sourcemap->getStack($line - $this->lineOffset) as $stack){ |
|
| 35 | 35 | $userStack[] = [ |
| 36 | 36 | 'file' => $stack['file'], |
| 37 | 37 | 'line' => $stack['line'], |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'args' => [$data], |
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | - if ($stack['file'] === $filename) { |
|
| 44 | + if ($stack['file'] === $filename){ |
|
| 45 | 45 | // no need to jump over root template |
| 46 | 46 | break; |
| 47 | 47 | } |
@@ -56,7 +56,8 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function load(string $path): Source |
| 58 | 58 | { |
| 59 | - if ($this->context === null) { |
|
| 59 | + if ($this->context === null) |
|
| 60 | + { |
|
| 60 | 61 | throw new EngineException('Unable to use StemplerLoader without given context.'); |
| 61 | 62 | } |
| 62 | 63 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function __construct( |
| 24 | 24 | private readonly LoaderInterface $loader, |
| 25 | 25 | array $processors |
| 26 | - ) { |
|
| 26 | + ){ |
|
| 27 | 27 | $this->processors = $processors; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function load(string $path): Source |
| 42 | 42 | { |
| 43 | - if ($this->context === null) { |
|
| 43 | + if ($this->context === null){ |
|
| 44 | 44 | throw new EngineException('Unable to use StemplerLoader without given context.'); |
| 45 | 45 | } |
| 46 | 46 | |