@@ -17,9 +17,9 @@ |
||
17 | 17 | { |
18 | 18 | $app = $this->makeApp(); |
19 | 19 | |
20 | - try { |
|
20 | + try{ |
|
21 | 21 | throw new \Error("test error"); |
22 | - } catch (\Error $e) { |
|
22 | + }catch (\Error $e){ |
|
23 | 23 | /** @var SnapshotInterface $s */ |
24 | 24 | $s = $app->get(SnapshotterInterface::class)->register($e); |
25 | 25 | } |
@@ -17,9 +17,12 @@ |
||
17 | 17 | { |
18 | 18 | $app = $this->makeApp(); |
19 | 19 | |
20 | - try { |
|
20 | + try |
|
21 | + { |
|
21 | 22 | throw new \Error("test error"); |
22 | - } catch (\Error $e) { |
|
23 | + } |
|
24 | + catch (\Error $e) |
|
25 | + { |
|
23 | 26 | /** @var SnapshotInterface $s */ |
24 | 27 | $s = $app->get(SnapshotterInterface::class)->register($e); |
25 | 28 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function testNotSidWhenNotStarted() |
17 | 17 | { |
18 | - $this->http->setHandler(function () { |
|
18 | + $this->http->setHandler(function (){ |
|
19 | 19 | $this->assertTrue($this->app->getContainer()->has(SessionInterface::class)); |
20 | 20 | |
21 | 21 | return 'all good'; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function testSetSid() |
32 | 32 | { |
33 | - $this->http->setHandler(function () { |
|
33 | + $this->http->setHandler(function (){ |
|
34 | 34 | return ++$this->session()->getSection('cli')->value; |
35 | 35 | }); |
36 | 36 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function testSessionResume() |
46 | 46 | { |
47 | - $this->http->setHandler(function () { |
|
47 | + $this->http->setHandler(function (){ |
|
48 | 48 | return ++$this->session()->getSection('cli')->value; |
49 | 49 | }); |
50 | 50 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | public function testSessionRegenerateId() |
70 | 70 | { |
71 | - $this->http->setHandler(function () { |
|
71 | + $this->http->setHandler(function (){ |
|
72 | 72 | return ++$this->session()->getSection('cli')->value; |
73 | 73 | }); |
74 | 74 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->assertSame(200, $result->getStatusCode()); |
87 | 87 | $this->assertSame('2', $result->getBody()->__toString()); |
88 | 88 | |
89 | - $this->http->setHandler(function () { |
|
89 | + $this->http->setHandler(function (){ |
|
90 | 90 | $this->session()->regenerateID(false); |
91 | 91 | |
92 | 92 | return ++$this->session()->getSection('cli')->value; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | public function testDestroySession() |
107 | 107 | { |
108 | - $this->http->setHandler(function () { |
|
108 | + $this->http->setHandler(function (){ |
|
109 | 109 | $this->assertInternalType('array', $this->session()->__debugInfo()); |
110 | 110 | |
111 | 111 | return ++$this->session()->getSection('cli')->value; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | ]); |
121 | 121 | $this->assertSame(200, $result->getStatusCode()); |
122 | 122 | $this->assertSame('2', $result->getBody()->__toString()); |
123 | - $this->http->setHandler(function () { |
|
123 | + $this->http->setHandler(function (){ |
|
124 | 124 | $this->session()->destroy(); |
125 | 125 | $this->assertFalse($this->session()->isStarted()); |
126 | 126 |
@@ -15,7 +15,8 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function testNotSidWhenNotStarted() |
17 | 17 | { |
18 | - $this->http->setHandler(function () { |
|
18 | + $this->http->setHandler(function () |
|
19 | + { |
|
19 | 20 | $this->assertTrue($this->app->getContainer()->has(SessionInterface::class)); |
20 | 21 | |
21 | 22 | return 'all good'; |
@@ -30,7 +31,8 @@ discard block |
||
30 | 31 | |
31 | 32 | public function testSetSid() |
32 | 33 | { |
33 | - $this->http->setHandler(function () { |
|
34 | + $this->http->setHandler(function () |
|
35 | + { |
|
34 | 36 | return ++$this->session()->getSection('cli')->value; |
35 | 37 | }); |
36 | 38 | |
@@ -44,7 +46,8 @@ discard block |
||
44 | 46 | |
45 | 47 | public function testSessionResume() |
46 | 48 | { |
47 | - $this->http->setHandler(function () { |
|
49 | + $this->http->setHandler(function () |
|
50 | + { |
|
48 | 51 | return ++$this->session()->getSection('cli')->value; |
49 | 52 | }); |
50 | 53 | |
@@ -68,7 +71,8 @@ discard block |
||
68 | 71 | |
69 | 72 | public function testSessionRegenerateId() |
70 | 73 | { |
71 | - $this->http->setHandler(function () { |
|
74 | + $this->http->setHandler(function () |
|
75 | + { |
|
72 | 76 | return ++$this->session()->getSection('cli')->value; |
73 | 77 | }); |
74 | 78 | |
@@ -86,7 +90,8 @@ discard block |
||
86 | 90 | $this->assertSame(200, $result->getStatusCode()); |
87 | 91 | $this->assertSame('2', $result->getBody()->__toString()); |
88 | 92 | |
89 | - $this->http->setHandler(function () { |
|
93 | + $this->http->setHandler(function () |
|
94 | + { |
|
90 | 95 | $this->session()->regenerateID(false); |
91 | 96 | |
92 | 97 | return ++$this->session()->getSection('cli')->value; |
@@ -105,7 +110,8 @@ discard block |
||
105 | 110 | |
106 | 111 | public function testDestroySession() |
107 | 112 | { |
108 | - $this->http->setHandler(function () { |
|
113 | + $this->http->setHandler(function () |
|
114 | + { |
|
109 | 115 | $this->assertInternalType('array', $this->session()->__debugInfo()); |
110 | 116 | |
111 | 117 | return ++$this->session()->getSection('cli')->value; |
@@ -120,7 +126,8 @@ discard block |
||
120 | 126 | ]); |
121 | 127 | $this->assertSame(200, $result->getStatusCode()); |
122 | 128 | $this->assertSame('2', $result->getBody()->__toString()); |
123 | - $this->http->setHandler(function () { |
|
129 | + $this->http->setHandler(function () |
|
130 | + { |
|
124 | 131 | $this->session()->destroy(); |
125 | 132 | $this->assertFalse($this->session()->isStarted()); |
126 | 133 |
@@ -19,7 +19,8 @@ |
||
19 | 19 | |
20 | 20 | public function tearDown() |
21 | 21 | { |
22 | - if (file_exists(self::TEST_FILE)) { |
|
22 | + if (file_exists(self::TEST_FILE)) |
|
23 | + { |
|
23 | 24 | unlink(self::TEST_FILE); |
24 | 25 | } |
25 | 26 |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | |
15 | 15 | class PublishTest extends ConsoleTest |
16 | 16 | { |
17 | - protected const TEST_FILE = __DIR__ . '/test.txt'; |
|
18 | - protected const TEST_FILE_2 = __DIR__ . '/PublishTest.php'; |
|
17 | + protected const TEST_FILE = __DIR__.'/test.txt'; |
|
18 | + protected const TEST_FILE_2 = __DIR__.'/PublishTest.php'; |
|
19 | 19 | |
20 | 20 | public function tearDown() |
21 | 21 | { |
22 | - if (file_exists(self::TEST_FILE)) { |
|
22 | + if (file_exists(self::TEST_FILE)){ |
|
23 | 23 | unlink(self::TEST_FILE); |
24 | 24 | } |
25 | 25 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->runCommandDebug('publish', [ |
176 | 176 | 'type' => 'replace', |
177 | 177 | 'target' => '@runtime', |
178 | - 'source' => __DIR__ . '/*', |
|
178 | + 'source' => __DIR__.'/*', |
|
179 | 179 | 'mode' => 'runtime' |
180 | 180 | ]); |
181 | 181 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->runCommandDebug('publish', [ |
194 | 194 | 'type' => 'follow', |
195 | 195 | 'target' => '@runtime', |
196 | - 'source' => __DIR__ . '/*', |
|
196 | + 'source' => __DIR__.'/*', |
|
197 | 197 | 'mode' => 'runtime' |
198 | 198 | ]); |
199 | 199 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $this->runCommandDebug('publish', [ |
212 | 212 | 'type' => 'follow', |
213 | 213 | 'target' => '@runtime/test.txt', |
214 | - 'source' => self::TEST_FILE . 'invalid', |
|
214 | + 'source' => self::TEST_FILE.'invalid', |
|
215 | 215 | 'mode' => 'runtime' |
216 | 216 | ]); |
217 | 217 | } |
@@ -226,13 +226,13 @@ discard block |
||
226 | 226 | $this->runCommandDebug('publish', [ |
227 | 227 | 'type' => 'follow', |
228 | 228 | 'target' => '@runtime/test.txt', |
229 | - 'source' => self::TEST_FILE . 'invalid/*', |
|
229 | + 'source' => self::TEST_FILE.'invalid/*', |
|
230 | 230 | 'mode' => 'runtime' |
231 | 231 | ]); |
232 | 232 | } |
233 | 233 | |
234 | 234 | protected function file(string $dir, string $name) |
235 | 235 | { |
236 | - return $this->app->get(DirectoriesInterface::class)->get($dir) . $name; |
|
236 | + return $this->app->get(DirectoriesInterface::class)->get($dir).$name; |
|
237 | 237 | } |
238 | 238 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | public function inputAction(RequestInput $i) |
38 | 38 | { |
39 | - return 'value: ' . $i->withPrefix('section')->getValue('query', 'value'); |
|
39 | + return 'value: '.$i->withPrefix('section')->getValue('query', 'value'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function errorAction() |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | public function compile(string $path, ContextInterface $context) |
22 | 22 | { |
23 | - if ($path == 'custom:error') { |
|
23 | + if ($path == 'custom:error'){ |
|
24 | 24 | throw new EngineException("Unable to compile custom:error"); |
25 | 25 | } |
26 | 26 | } |
@@ -20,7 +20,8 @@ |
||
20 | 20 | |
21 | 21 | public function compile(string $path, ContextInterface $context) |
22 | 22 | { |
23 | - if ($path == 'custom:error') { |
|
23 | + if ($path == 'custom:error') |
|
24 | + { |
|
24 | 25 | throw new EngineException("Unable to compile custom:error"); |
25 | 26 | } |
26 | 27 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | ] |
104 | 104 | ]); |
105 | 105 | |
106 | - $tokenizer->addDirectory(directory('vendor') . 'spiral/validation/src/'); |
|
106 | + $tokenizer->addDirectory(directory('vendor').'spiral/validation/src/'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -58,8 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
62 | - $dirs->set('locale', $dirs->get('app') . 'locale/'); |
|
61 | + if (!$dirs->has('locale')){ |
|
62 | + $dirs->set('locale', $dirs->get('app').'locale/'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->config->setDefaults('translator', [ |
@@ -58,7 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
61 | + if (!$dirs->has('locale')) |
|
62 | + { |
|
62 | 63 | $dirs->set('locale', $dirs->get('app') . 'locale/'); |
63 | 64 | } |
64 | 65 |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
46 | - $dirs->set('views', $dirs->get('app') . 'views'); |
|
45 | + if (!$dirs->has('views')){ |
|
46 | + $dirs->set('views', $dirs->get('app').'views'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // default view config |
50 | 50 | $this->config->setDefaults('views', [ |
51 | 51 | 'cache' => [ |
52 | 52 | 'enabled' => !$env->get('DEBUG', false), |
53 | - 'directory' => $dirs->get('cache') . 'views' |
|
53 | + 'directory' => $dirs->get('cache').'views' |
|
54 | 54 | ], |
55 | 55 | 'namespaces' => [ |
56 | 56 | 'default' => [$dirs->get('views')] |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function addDirectory(string $namespace, string $directory) |
68 | 68 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
69 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){ |
|
70 | 70 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 71 | } |
72 | 72 | |
73 | - $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory)); |
|
73 | + $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -42,7 +42,8 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
45 | + if (!$dirs->has('views')) |
|
46 | + { |
|
46 | 47 | $dirs->set('views', $dirs->get('app') . 'views'); |
47 | 48 | } |
48 | 49 | |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | */ |
67 | 68 | public function addDirectory(string $namespace, string $directory) |
68 | 69 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
70 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) |
|
71 | + { |
|
70 | 72 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 73 | } |
72 | 74 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $finalizer->addFinalizer(function () use ($container) { |
29 | 29 | /** @var DatabaseManager $dbal */ |
30 | 30 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
31 | + foreach ($dbal->getDrivers() as $driver){ |
|
32 | 32 | $driver->disconnect(); |
33 | 33 | } |
34 | 34 | }); |
@@ -25,10 +25,12 @@ |
||
25 | 25 | */ |
26 | 26 | public function boot(FinalizerInterface $finalizer, ContainerInterface $container) |
27 | 27 | { |
28 | - $finalizer->addFinalizer(function () use ($container) { |
|
28 | + $finalizer->addFinalizer(function () use ($container) |
|
29 | + { |
|
29 | 30 | /** @var DatabaseManager $dbal */ |
30 | 31 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
32 | + foreach ($dbal->getDrivers() as $driver) |
|
33 | + { |
|
32 | 34 | $driver->disconnect(); |
33 | 35 | } |
34 | 36 | }); |