Passed
Push — master ( 38237d...f3b30c )
by Kirill
02:36
created
tests/Framework/ConsoleTest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
 
32 32
         $fs = new Files();
33 33
 
34
-        if ($fs->isDirectory(__DIR__ . '/../app/migrations')) {
35
-            $fs->deleteDirectory(__DIR__ . '/../app/migrations');
34
+        if ($fs->isDirectory(__DIR__.'/../app/migrations')){
35
+            $fs->deleteDirectory(__DIR__.'/../app/migrations');
36 36
         }
37 37
 
38 38
         $runtime = $this->app->get(DirectoriesInterface::class)->get('runtime');
39
-        if ($fs->isDirectory($runtime)) {
39
+        if ($fs->isDirectory($runtime)){
40 40
             $fs->deleteDirectory($runtime);
41 41
         }
42 42
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,12 +31,14 @@
 block discarded – undo
31 31
 
32 32
         $fs = new Files();
33 33
 
34
-        if ($fs->isDirectory(__DIR__ . '/../app/migrations')) {
34
+        if ($fs->isDirectory(__DIR__ . '/../app/migrations'))
35
+        {
35 36
             $fs->deleteDirectory(__DIR__ . '/../app/migrations');
36 37
         }
37 38
 
38 39
         $runtime = $this->app->get(DirectoriesInterface::class)->get('runtime');
39
-        if ($fs->isDirectory($runtime)) {
40
+        if ($fs->isDirectory($runtime))
41
+        {
40 42
             $fs->deleteDirectory($runtime);
41 43
         }
42 44
     }
Please login to merge, or discard this patch.
tests/Framework/BaseTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@
 block discarded – undo
17 17
     public function makeApp(array $env = []): TestApp
18 18
     {
19 19
         return TestApp::init([
20
-            'root'    => __DIR__ . '/../..',
21
-            'app'     => __DIR__ . '/../app',
22
-            'runtime' => sys_get_temp_dir() . '/spiral',
23
-            'cache'   => sys_get_temp_dir() . '/spiral',
20
+            'root'    => __DIR__.'/../..',
21
+            'app'     => __DIR__.'/../app',
22
+            'runtime' => sys_get_temp_dir().'/spiral',
23
+            'cache'   => sys_get_temp_dir().'/spiral',
24 24
         ], new Environment($env), false);
25 25
     }
26 26
 }
Please login to merge, or discard this patch.
tests/Framework/SnapshotTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
     {
21 21
         $app = $this->makeApp();
22 22
 
23
-        try {
23
+        try{
24 24
             throw new \Error('test error');
25
-        } catch (\Error $e) {
25
+        }catch (\Error $e){
26 26
             /** @var SnapshotInterface $s */
27 27
             $s = $app->get(SnapshotterInterface::class)->register($e);
28 28
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,12 @@
 block discarded – undo
20 20
     {
21 21
         $app = $this->makeApp();
22 22
 
23
-        try {
23
+        try
24
+        {
24 25
             throw new \Error('test error');
25
-        } catch (\Error $e) {
26
+        }
27
+        catch (\Error $e)
28
+        {
26 29
             /** @var SnapshotInterface $s */
27 30
             $s = $app->get(SnapshotterInterface::class)->register($e);
28 31
         }
Please login to merge, or discard this patch.
tests/Framework/GRPC/ListTest.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
     public function setUp(): void
21 21
     {
22 22
         exec('protoc 2>&1', $out);
23
-        if (strpos(join("\n", $out), '--php_out') === false) {
23
+        if (strpos(join("\n", $out), '--php_out') === false)
24
+        {
24 25
             $this->markTestSkipped('Protoc binary is missing');
25 26
             return;
26 27
         }
@@ -40,11 +41,13 @@  discard block
 block discarded – undo
40 41
 
41 42
         $fs = new Files();
42 43
 
43
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
44
+        if ($fs->isDirectory($this->app->dir('app') . 'src/Service'))
45
+        {
44 46
             $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
45 47
         }
46 48
 
47
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
49
+        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata'))
50
+        {
48 51
             $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
49 52
         }
50 53
     }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function setUp(): void
22 22
     {
23 23
         exec('protoc 2>&1', $out);
24
-        if (strpos(join("\n", $out), '--php_out') === false) {
24
+        if (strpos(join("\n", $out), '--php_out') === false){
25 25
             $this->markTestSkipped('Protoc binary is missing');
26 26
             return;
27 27
         }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         parent::setUp();
30 30
 
31 31
         $fs = new Files();
32
-        $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto');
32
+        $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto');
33 33
 
34 34
         // protoc can't figure relative paths
35 35
         $this->proto = str_replace('Framework/../', '', $this->proto);
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 
42 42
         $fs = new Files();
43 43
 
44
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
45
-            $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
44
+        if ($fs->isDirectory($this->app->dir('app').'src/Service')){
45
+            $fs->deleteDirectory($this->app->dir('app').'src/Service');
46 46
         }
47 47
 
48
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
49
-            $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
48
+        if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){
49
+            $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata');
50 50
         }
51 51
     }
52 52
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             'proto' => $this->proto
64 64
         ]);
65 65
 
66
-        $output = $this->app->dir('app') . 'src/Service/EchoService.php';
66
+        $output = $this->app->dir('app').'src/Service/EchoService.php';
67 67
         file_put_contents($output, GenerateTest::SERVICE);
68 68
 
69 69
         $out = $this->runCommandDebug('grpc:services');
Please login to merge, or discard this patch.
tests/Framework/Module/PublishTest.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
tests/Framework/Http/SessionTest.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
tests/Framework/Http/SapiTest.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function setUp(): void
27 27
     {
28
-        $this->bufferEmitter = new class() implements EmitterInterface {
28
+        $this->bufferEmitter = new class() implements EmitterInterface{
29 29
             public $response;
30 30
 
31 31
             public function emit(ResponseInterface $response): bool
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $e = $this->bufferEmitter;
60 60
 
61 61
         $files = $this->app->get(FilesInterface::class)->getFiles(
62
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
62
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
63 63
         );
64 64
 
65 65
         $this->assertCount(0, $files);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $this->app->get(SapiDispatcher::class)->serve($e);
69 69
 
70 70
         $files = $this->app->get(FilesInterface::class)->getFiles(
71
-            $this->app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
71
+            $this->app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
72 72
         );
73 73
 
74 74
         $this->assertCount(1, $files);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         ]);
86 86
 
87 87
         $files = $app->get(FilesInterface::class)->getFiles(
88
-            $app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
88
+            $app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
89 89
         );
90 90
 
91 91
         $this->assertCount(0, $files);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $app->get(SapiDispatcher::class)->serve($e);
95 95
 
96 96
         $files = $app->get(FilesInterface::class)->getFiles(
97
-            $app->get(DirectoriesInterface::class)->get('runtime') . '/snapshots/'
97
+            $app->get(DirectoriesInterface::class)->get('runtime').'/snapshots/'
98 98
         );
99 99
 
100 100
         $this->assertCount(1, $files);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
 
26 26
     public function setUp(): void
27 27
     {
28
-        $this->bufferEmitter = new class() implements EmitterInterface {
28
+        $this->bufferEmitter = new class() implements EmitterInterface
29
+        {
29 30
             public $response;
30 31
 
31 32
             public function emit(ResponseInterface $response): bool
Please login to merge, or discard this patch.
tests/app/src/Bootloader/AppBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             new Route('/auth/<action>', new Controller(AuthController::class))
50 50
         );
51 51
 
52
-        $views->addDirectory('custom', __DIR__ . '/../../views/custom/');
52
+        $views->addDirectory('custom', __DIR__.'/../../views/custom/');
53 53
         $views->addEngine(TestEngine::class);
54 54
 
55 55
         $validation->addAlias('aliased', 'notEmpty');
Please login to merge, or discard this patch.
tests/app/src/Controller/TestController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
 
49 49
     public function input(InputScope $i)
50 50
     {
51
-        return 'value: ' . $i->withPrefix('section')->getValue('query', 'value');
51
+        return 'value: '.$i->withPrefix('section')->getValue('query', 'value');
52 52
     }
53 53
 
54 54
     public function error(): void
Please login to merge, or discard this patch.