@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function testMountFileNotFound(): void |
25 | 25 | { |
26 | 26 | $out = $this->runCommand('encrypt:key', [ |
27 | - '-m' => __DIR__ . '/.env' |
|
27 | + '-m' => __DIR__.'/.env' |
|
28 | 28 | ]); |
29 | 29 | |
30 | 30 | $this->assertContains('Unable to find', $out); |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | |
33 | 33 | public function testReplace(): void |
34 | 34 | { |
35 | - file_put_contents(__DIR__ . '/.env', '{encrypt-key}'); |
|
35 | + file_put_contents(__DIR__.'/.env', '{encrypt-key}'); |
|
36 | 36 | |
37 | 37 | $out = $this->runCommand('encrypt:key', [ |
38 | - '-m' => __DIR__ . '/.env' |
|
38 | + '-m' => __DIR__.'/.env' |
|
39 | 39 | ]); |
40 | 40 | |
41 | 41 | $this->assertContains('key has been updated', $out); |
42 | 42 | |
43 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
43 | + $body = file_get_contents(__DIR__.'/.env'); |
|
44 | 44 | $this->assertContains($body, $out); |
45 | 45 | |
46 | - unlink(__DIR__ . '/.env'); |
|
46 | + unlink(__DIR__.'/.env'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function testReplaceCurrent(): void |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | 'ENCRYPTER_KEY' => $key |
55 | 55 | ]); |
56 | 56 | |
57 | - file_put_contents(__DIR__ . '/.env', $key); |
|
57 | + file_put_contents(__DIR__.'/.env', $key); |
|
58 | 58 | |
59 | 59 | $out = $app->console()->run('encrypt:key', [ |
60 | - '-m' => __DIR__ . '/.env' |
|
60 | + '-m' => __DIR__.'/.env' |
|
61 | 61 | ]); |
62 | 62 | $out = $out->getOutput()->fetch(); |
63 | 63 | |
64 | 64 | $this->assertContains('key has been updated', $out); |
65 | 65 | |
66 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
66 | + $body = file_get_contents(__DIR__.'/.env'); |
|
67 | 67 | $this->assertContains($body, $out); |
68 | 68 | |
69 | - unlink(__DIR__ . '/.env'); |
|
69 | + unlink(__DIR__.'/.env'); |
|
70 | 70 | } |
71 | 71 | } |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | |
16 | 16 | class PublishTest extends ConsoleTest |
17 | 17 | { |
18 | - protected const TEST_FILE = __DIR__ . '/test.txt'; |
|
19 | - protected const TEST_FILE_2 = __DIR__ . '/PublishTest.php'; |
|
18 | + protected const TEST_FILE = __DIR__.'/test.txt'; |
|
19 | + protected const TEST_FILE_2 = __DIR__.'/PublishTest.php'; |
|
20 | 20 | |
21 | 21 | public function tearDown(): void |
22 | 22 | { |
23 | - if (file_exists(self::TEST_FILE)) { |
|
23 | + if (file_exists(self::TEST_FILE)){ |
|
24 | 24 | unlink(self::TEST_FILE); |
25 | 25 | } |
26 | 26 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $this->runCommandDebug('publish', [ |
177 | 177 | 'type' => 'replace', |
178 | 178 | 'target' => '@runtime', |
179 | - 'source' => __DIR__ . '/*', |
|
179 | + 'source' => __DIR__.'/*', |
|
180 | 180 | 'mode' => 'runtime' |
181 | 181 | ]); |
182 | 182 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $this->runCommandDebug('publish', [ |
195 | 195 | 'type' => 'follow', |
196 | 196 | 'target' => '@runtime', |
197 | - 'source' => __DIR__ . '/*', |
|
197 | + 'source' => __DIR__.'/*', |
|
198 | 198 | 'mode' => 'runtime' |
199 | 199 | ]); |
200 | 200 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $this->runCommandDebug('publish', [ |
213 | 213 | 'type' => 'follow', |
214 | 214 | 'target' => '@runtime/test.txt', |
215 | - 'source' => self::TEST_FILE . 'invalid', |
|
215 | + 'source' => self::TEST_FILE.'invalid', |
|
216 | 216 | 'mode' => 'runtime' |
217 | 217 | ]); |
218 | 218 | } |
@@ -227,13 +227,13 @@ discard block |
||
227 | 227 | $this->runCommandDebug('publish', [ |
228 | 228 | 'type' => 'follow', |
229 | 229 | 'target' => '@runtime/test.txt', |
230 | - 'source' => self::TEST_FILE . 'invalid/*', |
|
230 | + 'source' => self::TEST_FILE.'invalid/*', |
|
231 | 231 | 'mode' => 'runtime' |
232 | 232 | ]); |
233 | 233 | } |
234 | 234 | |
235 | 235 | protected function file(string $dir, string $name) |
236 | 236 | { |
237 | - return $this->app->get(DirectoriesInterface::class)->get($dir) . $name; |
|
237 | + return $this->app->get(DirectoriesInterface::class)->get($dir).$name; |
|
238 | 238 | } |
239 | 239 | } |
@@ -20,7 +20,8 @@ |
||
20 | 20 | |
21 | 21 | public function tearDown(): void |
22 | 22 | { |
23 | - if (file_exists(self::TEST_FILE)) { |
|
23 | + if (file_exists(self::TEST_FILE)) |
|
24 | + { |
|
24 | 25 | unlink(self::TEST_FILE); |
25 | 26 | } |
26 | 27 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | public function compile(string $path, ContextInterface $context): void |
33 | 33 | { |
34 | - if ($path == 'custom:error') { |
|
34 | + if ($path == 'custom:error'){ |
|
35 | 35 | throw new EngineException('Unable to compile custom:error'); |
36 | 36 | } |
37 | 37 | } |
@@ -31,7 +31,8 @@ |
||
31 | 31 | |
32 | 32 | public function compile(string $path, ContextInterface $context): void |
33 | 33 | { |
34 | - if ($path == 'custom:error') { |
|
34 | + if ($path == 'custom:error') |
|
35 | + { |
|
35 | 36 | throw new EngineException('Unable to compile custom:error'); |
36 | 37 | } |
37 | 38 | } |
@@ -12,4 +12,4 @@ |
||
12 | 12 | ini_set('display_errors', '1'); |
13 | 13 | |
14 | 14 | //Composer |
15 | -require dirname(__DIR__) . '/vendor/autoload.php'; |
|
15 | +require dirname(__DIR__).'/vendor/autoload.php'; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function getValue(string $source, string $name = null) |
43 | 43 | { |
44 | - if (!method_exists($this->input, $source)) { |
|
44 | + if (!method_exists($this->input, $source)){ |
|
45 | 45 | throw new InputException("Undefined input source '{$source}'"); |
46 | 46 | } |
47 | 47 |
@@ -41,7 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | public function getValue(string $source, string $name = null) |
43 | 43 | { |
44 | - if (!method_exists($this->input, $source)) { |
|
44 | + if (!method_exists($this->input, $source)) |
|
45 | + { |
|
45 | 46 | throw new InputException("Undefined input source '{$source}'"); |
46 | 47 | } |
47 | 48 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | private function route(ServerRequestInterface $request): RouteInterface |
58 | 58 | { |
59 | 59 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
60 | - if ($route === null) { |
|
60 | + if ($route === null){ |
|
61 | 61 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
62 | 62 | } |
63 | 63 |
@@ -57,7 +57,8 @@ |
||
57 | 57 | private function route(ServerRequestInterface $request): RouteInterface |
58 | 58 | { |
59 | 59 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
60 | - if ($route === null) { |
|
60 | + if ($route === null) |
|
61 | + { |
|
61 | 62 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
62 | 63 | } |
63 | 64 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
73 | 73 | { |
74 | 74 | $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
75 | - if ($cookieQueue === null) { |
|
75 | + if ($cookieQueue === null){ |
|
76 | 76 | throw new ScopeException('Unable to resolve CookieQueue, invalid request scope'); |
77 | 77 | } |
78 | 78 |
@@ -72,7 +72,8 @@ |
||
72 | 72 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
73 | 73 | { |
74 | 74 | $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
75 | - if ($cookieQueue === null) { |
|
75 | + if ($cookieQueue === null) |
|
76 | + { |
|
76 | 77 | throw new ScopeException('Unable to resolve CookieQueue, invalid request scope'); |
77 | 78 | } |
78 | 79 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->assertNull($this->app->getEnvironment()->get('FIRED')); |
42 | 42 | |
43 | 43 | $w->shouldReceive('receive')->once()->with( |
44 | - \Mockery::on(function (&$context) { |
|
44 | + \Mockery::on(function (&$context){ |
|
45 | 45 | $context = '{ |
46 | 46 | "id": "1", |
47 | 47 | "job": "spiral.app.job.TestJob" |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->app->getContainer()->bind(Worker::class, $w); |
70 | 70 | |
71 | 71 | $w->shouldReceive('receive')->once()->with( |
72 | - \Mockery::on(function (&$context) { |
|
72 | + \Mockery::on(function (&$context){ |
|
73 | 73 | $context = '{ |
74 | 74 | "id": "1", |
75 | 75 | "job": "spiral.app.job.ErrorJob" |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $w->shouldReceive('receive')->once()->andReturn(null); |
86 | 86 | |
87 | 87 | $files = $this->app->get(FilesInterface::class)->getFiles( |
88 | - $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/' |
|
88 | + $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/' |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | $this->assertCount(0, $files); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $this->app->get(JobDispatcher::class)->serve(); |
94 | 94 | |
95 | 95 | $files = $this->app->get(FilesInterface::class)->getFiles( |
96 | - $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/' |
|
96 | + $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/' |
|
97 | 97 | ); |
98 | 98 | |
99 | 99 | $this->assertCount(1, $files); |
@@ -41,7 +41,8 @@ discard block |
||
41 | 41 | $this->assertNull($this->app->getEnvironment()->get('FIRED')); |
42 | 42 | |
43 | 43 | $w->shouldReceive('receive')->once()->with( |
44 | - \Mockery::on(function (&$context) { |
|
44 | + \Mockery::on(function (&$context) |
|
45 | + { |
|
45 | 46 | $context = '{ |
46 | 47 | "id": "1", |
47 | 48 | "job": "spiral.app.job.TestJob" |
@@ -69,7 +70,8 @@ discard block |
||
69 | 70 | $this->app->getContainer()->bind(Worker::class, $w); |
70 | 71 | |
71 | 72 | $w->shouldReceive('receive')->once()->with( |
72 | - \Mockery::on(function (&$context) { |
|
73 | + \Mockery::on(function (&$context) |
|
74 | + { |
|
73 | 75 | $context = '{ |
74 | 76 | "id": "1", |
75 | 77 | "job": "spiral.app.job.ErrorJob" |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | public function testSetSid(): void |
20 | 20 | { |
21 | - $this->http->setHandler(function () { |
|
21 | + $this->http->setHandler(function (){ |
|
22 | 22 | return ++$this->session()->getSection('cli')->value; |
23 | 23 | }); |
24 | 24 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function testSessionResume(): void |
34 | 34 | { |
35 | - $this->http->setHandler(function () { |
|
35 | + $this->http->setHandler(function (){ |
|
36 | 36 | return ++$this->session()->getSection('cli')->value; |
37 | 37 | }); |
38 | 38 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | public function testSessionRegenerateId(): void |
58 | 58 | { |
59 | - $this->http->setHandler(function () { |
|
59 | + $this->http->setHandler(function (){ |
|
60 | 60 | return ++$this->session()->getSection('cli')->value; |
61 | 61 | }); |
62 | 62 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $this->assertSame(200, $result->getStatusCode()); |
74 | 74 | $this->assertSame('2', $result->getBody()->__toString()); |
75 | 75 | |
76 | - $this->http->setHandler(function () { |
|
76 | + $this->http->setHandler(function (){ |
|
77 | 77 | $this->session()->regenerateID(false); |
78 | 78 | |
79 | 79 | return ++$this->session()->getSection('cli')->value; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function testDestroySession(): void |
94 | 94 | { |
95 | - $this->http->setHandler(function () { |
|
95 | + $this->http->setHandler(function (){ |
|
96 | 96 | return ++$this->session()->getSection('cli')->value; |
97 | 97 | }); |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ]); |
106 | 106 | $this->assertSame(200, $result->getStatusCode()); |
107 | 107 | $this->assertSame('2', $result->getBody()->__toString()); |
108 | - $this->http->setHandler(function () { |
|
108 | + $this->http->setHandler(function (){ |
|
109 | 109 | $this->session()->destroy(); |
110 | 110 | $this->assertFalse($this->session()->isStarted()); |
111 | 111 |
@@ -18,7 +18,8 @@ discard block |
||
18 | 18 | { |
19 | 19 | public function testSetSid(): void |
20 | 20 | { |
21 | - $this->http->setHandler(function () { |
|
21 | + $this->http->setHandler(function () |
|
22 | + { |
|
22 | 23 | return ++$this->session()->getSection('cli')->value; |
23 | 24 | }); |
24 | 25 | |
@@ -32,7 +33,8 @@ discard block |
||
32 | 33 | |
33 | 34 | public function testSessionResume(): void |
34 | 35 | { |
35 | - $this->http->setHandler(function () { |
|
36 | + $this->http->setHandler(function () |
|
37 | + { |
|
36 | 38 | return ++$this->session()->getSection('cli')->value; |
37 | 39 | }); |
38 | 40 | |
@@ -56,7 +58,8 @@ discard block |
||
56 | 58 | |
57 | 59 | public function testSessionRegenerateId(): void |
58 | 60 | { |
59 | - $this->http->setHandler(function () { |
|
61 | + $this->http->setHandler(function () |
|
62 | + { |
|
60 | 63 | return ++$this->session()->getSection('cli')->value; |
61 | 64 | }); |
62 | 65 | |
@@ -73,7 +76,8 @@ discard block |
||
73 | 76 | $this->assertSame(200, $result->getStatusCode()); |
74 | 77 | $this->assertSame('2', $result->getBody()->__toString()); |
75 | 78 | |
76 | - $this->http->setHandler(function () { |
|
79 | + $this->http->setHandler(function () |
|
80 | + { |
|
77 | 81 | $this->session()->regenerateID(false); |
78 | 82 | |
79 | 83 | return ++$this->session()->getSection('cli')->value; |
@@ -92,7 +96,8 @@ discard block |
||
92 | 96 | |
93 | 97 | public function testDestroySession(): void |
94 | 98 | { |
95 | - $this->http->setHandler(function () { |
|
99 | + $this->http->setHandler(function () |
|
100 | + { |
|
96 | 101 | return ++$this->session()->getSection('cli')->value; |
97 | 102 | }); |
98 | 103 | |
@@ -105,7 +110,8 @@ discard block |
||
105 | 110 | ]); |
106 | 111 | $this->assertSame(200, $result->getStatusCode()); |
107 | 112 | $this->assertSame('2', $result->getBody()->__toString()); |
108 | - $this->http->setHandler(function () { |
|
113 | + $this->http->setHandler(function () |
|
114 | + { |
|
109 | 115 | $this->session()->destroy(); |
110 | 116 | $this->assertFalse($this->session()->isStarted()); |
111 | 117 |