Passed
Push — master ( 810673...436c58 )
by Anton
02:43
created
tests/Framework/GRPC/GenerateTest.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
     public function setUp(): void
34 34
     {
35 35
         exec('protoc 2>&1', $out);
36
-        if (strpos(join("\n", $out), '--php_out') === false) {
36
+        if (strpos(join("\n", $out), '--php_out') === false){
37 37
             $this->markTestSkipped('Protoc binary is missing');
38 38
         }
39 39
 
40 40
         parent::setUp();
41 41
 
42 42
         $fs = new Files();
43
-        $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto');
43
+        $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto');
44 44
 
45 45
         // protoc can't figure relative paths
46 46
         $this->proto = str_replace('Framework/../', '', $this->proto);
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 
53 53
         $fs = new Files();
54 54
 
55
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
56
-            $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
55
+        if ($fs->isDirectory($this->app->dir('app').'src/Service')){
56
+            $fs->deleteDirectory($this->app->dir('app').'src/Service');
57 57
         }
58 58
 
59
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
60
-            $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
59
+        if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){
60
+            $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata');
61 61
         }
62 62
     }
63 63
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
             'proto' => $this->proto
86 86
         ]);
87 87
 
88
-        $this->assertFileExists($this->app->dir('app') . 'src/Service/EchoInterface.php');
89
-        $this->assertFileExists($this->app->dir('app') . 'src/Service/Sub/Message.php');
90
-        $this->assertFileExists($this->app->dir('app') . 'src/GPBMetadata/Service.php');
88
+        $this->assertFileExists($this->app->dir('app').'src/Service/EchoInterface.php');
89
+        $this->assertFileExists($this->app->dir('app').'src/Service/Sub/Message.php');
90
+        $this->assertFileExists($this->app->dir('app').'src/GPBMetadata/Service.php');
91 91
     }
92 92
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,8 @@  discard block
 block discarded – undo
33 33
     public function setUp(): void
34 34
     {
35 35
         exec('protoc 2>&1', $out);
36
-        if (strpos(join("\n", $out), '--php_out') === false) {
36
+        if (strpos(join("\n", $out), '--php_out') === false)
37
+        {
37 38
             $this->markTestSkipped('Protoc binary is missing');
38 39
         }
39 40
 
@@ -52,11 +53,13 @@  discard block
 block discarded – undo
52 53
 
53 54
         $fs = new Files();
54 55
 
55
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
56
+        if ($fs->isDirectory($this->app->dir('app') . 'src/Service'))
57
+        {
56 58
             $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
57 59
         }
58 60
 
59
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
61
+        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata'))
62
+        {
60 63
             $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
61 64
         }
62 65
     }
Please login to merge, or discard this patch.
tests/Framework/GRPC/ListTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  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
             $this->markTestSkipped('Protoc binary is missing');
25 25
             return;
26 26
         }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         parent::setUp();
29 29
 
30 30
         $fs = new Files();
31
-        $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto');
31
+        $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto');
32 32
 
33 33
         // protoc can't figure relative paths
34 34
         $this->proto = str_replace('Framework/../', '', $this->proto);
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
 
41 41
         $fs = new Files();
42 42
 
43
-        if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) {
44
-            $fs->deleteDirectory($this->app->dir('app') . 'src/Service');
43
+        if ($fs->isDirectory($this->app->dir('app').'src/Service')){
44
+            $fs->deleteDirectory($this->app->dir('app').'src/Service');
45 45
         }
46 46
 
47
-        if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) {
48
-            $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata');
47
+        if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){
48
+            $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata');
49 49
         }
50 50
     }
51 51
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             'proto' => $this->proto
63 63
         ]);
64 64
 
65
-        file_put_contents($this->app->dir('app') . 'src/Service/EchoService.php', GenerateTest::SERVICE);
65
+        file_put_contents($this->app->dir('app').'src/Service/EchoService.php', GenerateTest::SERVICE);
66 66
 
67 67
         $out = $this->runCommandDebug('grpc:services');
68 68
 
Please login to merge, or discard this patch.
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.
tests/Framework/Encrypter/KeyCommandTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
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/app/src/Bootloader/AppBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
         $router->setDefault($route->withDefaults(['name' => 'Dave']));
45 45
 
46
-        $views->addDirectory('custom', __DIR__ . '/../../views/custom/');
46
+        $views->addDirectory('custom', __DIR__.'/../../views/custom/');
47 47
         $views->addEngine(TestEngine::class);
48 48
 
49 49
         $validation->addAlias('aliased', 'notEmpty');
Please login to merge, or discard this patch.
tests/app/src/ViewEngine/TestEngine.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,4 +12,4 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.
src/Filter/InputScope.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Session/Middleware/SessionMiddleware.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         CookiesConfig $cookiesConfig,
58 58
         SessionFactory $factory,
59 59
         ScopeInterface $scope
60
-    ) {
60
+    ){
61 61
         $this->config = $config;
62 62
         $this->httpConfig = $httpConfig;
63 63
         $this->cookiesConfig = $cookiesConfig;
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
             $this->fetchID($request)
77 77
         );
78 78
 
79
-        try {
79
+        try{
80 80
             $response = $handler->handle($request->withAttribute(static::ATTRIBUTE, $session));
81
-        } catch (\Throwable $e) {
81
+        }catch (\Throwable $e){
82 82
             $session->abort();
83 83
             throw $e;
84 84
         }
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
         Request $request,
98 98
         Response $response
99 99
     ): Response {
100
-        if (!$session->isStarted()) {
100
+        if (!$session->isStarted()){
101 101
             return $response;
102 102
         }
103 103
 
104 104
         $session->commit();
105 105
 
106 106
         //SID changed
107
-        if ($this->fetchID($request) != $session->getID()) {
107
+        if ($this->fetchID($request) != $session->getID()){
108 108
             return $this->withCookie($request, $response, $session->getID());
109 109
         }
110 110
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     protected function fetchID(Request $request): ?string
122 122
     {
123 123
         $cookies = $request->getCookieParams();
124
-        if (empty($cookies[$this->config->getCookie()])) {
124
+        if (empty($cookies[$this->config->getCookie()])){
125 125
             return null;
126 126
         }
127 127
 
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
     protected function clientSignature(Request $request): string
155 155
     {
156 156
         $signature = '';
157
-        foreach (static::SIGNATURE_HEADERS as $header) {
158
-            $signature .= $request->getHeaderLine($header) . ';';
157
+        foreach (static::SIGNATURE_HEADERS as $header){
158
+            $signature .= $request->getHeaderLine($header).';';
159 159
         }
160 160
 
161 161
         return hash('sha256', $signature);
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,9 +76,12 @@  discard block
 block discarded – undo
76 76
             $this->fetchID($request)
77 77
         );
78 78
 
79
-        try {
79
+        try
80
+        {
80 81
             $response = $handler->handle($request->withAttribute(static::ATTRIBUTE, $session));
81
-        } catch (\Throwable $e) {
82
+        }
83
+        catch (\Throwable $e)
84
+        {
82 85
             $session->abort();
83 86
             throw $e;
84 87
         }
@@ -97,14 +100,16 @@  discard block
 block discarded – undo
97 100
         Request $request,
98 101
         Response $response
99 102
     ): Response {
100
-        if (!$session->isStarted()) {
103
+        if (!$session->isStarted())
104
+        {
101 105
             return $response;
102 106
         }
103 107
 
104 108
         $session->commit();
105 109
 
106 110
         //SID changed
107
-        if ($this->fetchID($request) != $session->getID()) {
111
+        if ($this->fetchID($request) != $session->getID())
112
+        {
108 113
             return $this->withCookie($request, $response, $session->getID());
109 114
         }
110 115
 
@@ -121,7 +126,8 @@  discard block
 block discarded – undo
121 126
     protected function fetchID(Request $request): ?string
122 127
     {
123 128
         $cookies = $request->getCookieParams();
124
-        if (empty($cookies[$this->config->getCookie()])) {
129
+        if (empty($cookies[$this->config->getCookie()]))
130
+        {
125 131
             return null;
126 132
         }
127 133
 
@@ -154,7 +160,8 @@  discard block
 block discarded – undo
154 160
     protected function clientSignature(Request $request): string
155 161
     {
156 162
         $signature = '';
157
-        foreach (static::SIGNATURE_HEADERS as $header) {
163
+        foreach (static::SIGNATURE_HEADERS as $header)
164
+        {
158 165
             $signature .= $request->getHeaderLine($header) . ';';
159 166
         }
160 167
 
Please login to merge, or discard this patch.