Passed
Pull Request — master (#1207)
by Aleksei
10:55
created
src/AuthHttp/tests/Middleware/Firewall/ExceptionFirewallTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         $response = $http->handle(new ServerRequest('GET', '', ['X-Auth-Token' => $token], 'php://input'));
33 33
 
34
-        self::assertSame('OK', (string) $response->getBody());
34
+        self::assertSame('OK', (string)$response->getBody());
35 35
     }
36 36
 
37 37
     #[DataProvider('failTokensDataProvider')]
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
         $this->expectException(AuthException::class);
52 52
         $response = $http->handle(new ServerRequest('GET', '', ['X-Auth-Token' => $token], 'php://input'));
53 53
 
54
-        self::assertSame('OK', (string) $response->getBody());
54
+        self::assertSame('OK', (string)$response->getBody());
55 55
     }
56 56
 }
Please login to merge, or discard this patch.
src/Streams/tests/StreamsTest.php 2 patches
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -76,15 +76,21 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function testException(): void
78 78
     {
79
-        try {
79
+        try
80
+        {
80 81
             fopen('spiral://non-exists', 'rb');
81
-        } catch (\Throwable $e) {
82
+        }
83
+        catch (\Throwable $e)
84
+        {
82 85
             self::assertStringContainsString('failed to open stream', $e->getMessage());
83 86
         }
84 87
 
85
-        try {
88
+        try
89
+        {
86 90
             filemtime('spiral://non-exists');
87
-        } catch (\Throwable $e) {
91
+        }
92
+        catch (\Throwable $e)
93
+        {
88 94
             self::assertStringContainsString('stat failed', $e->getMessage());
89 95
         }
90 96
     }
@@ -94,15 +100,21 @@  discard block
 block discarded – undo
94 100
      */
95 101
     public function testExceptionPHP8(): void
96 102
     {
97
-        try {
103
+        try
104
+        {
98 105
             fopen('spiral://non-exists', 'rb');
99
-        } catch (\Throwable $e) {
106
+        }
107
+        catch (\Throwable $e)
108
+        {
100 109
             self::assertStringContainsString('Failed to open stream', $e->getMessage());
101 110
         }
102 111
 
103
-        try {
112
+        try
113
+        {
104 114
             filemtime('spiral://non-exists');
105
-        } catch (\Throwable $e) {
115
+        }
116
+        catch (\Throwable $e)
117
+        {
106 118
             self::assertStringContainsString('stat failed', $e->getMessage());
107 119
         }
108 120
     }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 class StreamsTest extends TestCase
12 12
 {
13
-    private const FIXTURE_DIRECTORY = __DIR__ . '/fixtures';
13
+    private const FIXTURE_DIRECTORY = __DIR__.'/fixtures';
14 14
 
15 15
     public function testGetUri(): void
16 16
     {
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         self::assertSame(strlen('sample text'), filesize($filename));
24 24
         self::assertSame(md5('sample text'), md5_file($filename));
25 25
 
26
-        $newFilename = self::FIXTURE_DIRECTORY . '/test.txt';
26
+        $newFilename = self::FIXTURE_DIRECTORY.'/test.txt';
27 27
         copy($filename, $newFilename);
28 28
 
29 29
         self::assertFileExists($newFilename);
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function testException(): void
66 66
     {
67
-        try {
67
+        try{
68 68
             fopen('spiral://non-exists', 'rb');
69
-        } catch (\Throwable $e) {
69
+        }catch (\Throwable $e){
70 70
             self::assertStringContainsString('failed to open stream', $e->getMessage());
71 71
         }
72 72
 
73
-        try {
73
+        try{
74 74
             filemtime('spiral://non-exists');
75
-        } catch (\Throwable $e) {
75
+        }catch (\Throwable $e){
76 76
             self::assertStringContainsString('stat failed', $e->getMessage());
77 77
         }
78 78
     }
@@ -82,15 +82,15 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function testExceptionPHP8(): void
84 84
     {
85
-        try {
85
+        try{
86 86
             fopen('spiral://non-exists', 'rb');
87
-        } catch (\Throwable $e) {
87
+        }catch (\Throwable $e){
88 88
             self::assertStringContainsString('Failed to open stream', $e->getMessage());
89 89
         }
90 90
 
91
-        try {
91
+        try{
92 92
             filemtime('spiral://non-exists');
93
-        } catch (\Throwable $e) {
93
+        }catch (\Throwable $e){
94 94
             self::assertStringContainsString('stat failed', $e->getMessage());
95 95
         }
96 96
     }
Please login to merge, or discard this patch.
src/Http/tests/ServerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
         $this->container->bind(ServerRequestInterface::class, $request);
169 169
 
170
-        self::assertSame(['PATH' => 'sample',], $this->input->server->__debugInfo());
170
+        self::assertSame(['PATH' => 'sample', ], $this->input->server->__debugInfo());
171 171
     }
172 172
 
173 173
     public function testIterator(): void
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
         $this->container->bind(ServerRequestInterface::class, $request);
182 182
 
183
-        self::assertSame(['PATH' => 'sample',], iterator_to_array($this->input->server));
183
+        self::assertSame(['PATH' => 'sample', ], iterator_to_array($this->input->server));
184 184
     }
185 185
 
186 186
     public function testSetAndExceptions(): void
Please login to merge, or discard this patch.
src/Scaffolder/tests/Command/InfoCommandTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             'create:jobHandler',
24 24
         ];
25 25
 
26
-        foreach ($strings as $string) {
26
+        foreach ($strings as $string){
27 27
             self::assertStringContainsString($string, $result);
28 28
         }
29 29
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
             'create:jobHandler',
24 24
         ];
25 25
 
26
-        foreach ($strings as $string) {
26
+        foreach ($strings as $string)
27
+        {
27 28
             self::assertStringContainsString($string, $result);
28 29
         }
29 30
     }
Please login to merge, or discard this patch.
src/Scaffolder/tests/Command/ConfigTest.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -130,17 +130,17 @@  discard block
 block discarded – undo
130 130
         ];
131 131
 
132 132
         $reflectionMethods = [];
133
-        foreach ($reflection->getMethods() as $method) {
134
-            if ($method->getDeclaringClass()->name !== $reflection->name) {
133
+        foreach ($reflection->getMethods() as $method){
134
+            if ($method->getDeclaringClass()->name !== $reflection->name){
135 135
                 continue;
136 136
             }
137 137
 
138 138
             $reflectionMethods[$method->name] = $method;
139 139
             self::assertArrayHasKey($method->name, $methods);
140 140
 
141
-            if (!$method->hasReturnType()) {
141
+            if (!$method->hasReturnType()){
142 142
                 self::assertNull($methods[$method->name]['hint']);
143
-            } else {
143
+            }else{
144 144
                 self::assertEquals($methods[$method->name]['hint'], $method->getReturnType()->getName());
145 145
             }
146 146
         }
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
         ];
181 181
 
182 182
         $reflectionMethods = [];
183
-        foreach ($reflection->getMethods() as $method) {
184
-            if ($method->getDeclaringClass()->name !== $reflection->name) {
183
+        foreach ($reflection->getMethods() as $method){
184
+            if ($method->getDeclaringClass()->name !== $reflection->name){
185 185
                 continue;
186 186
             }
187 187
             $reflectionMethods[$method->name] = $method;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
         clearstatcache();
268 268
 
269
-        $filename = $this->app->directory('config') . "$name.php";
269
+        $filename = $this->app->directory('config')."$name.php";
270 270
         self::assertFileExists($filename);
271 271
 
272 272
         return $filename;
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,17 +130,22 @@  discard block
 block discarded – undo
130 130
         ];
131 131
 
132 132
         $reflectionMethods = [];
133
-        foreach ($reflection->getMethods() as $method) {
134
-            if ($method->getDeclaringClass()->name !== $reflection->name) {
133
+        foreach ($reflection->getMethods() as $method)
134
+        {
135
+            if ($method->getDeclaringClass()->name !== $reflection->name)
136
+            {
135 137
                 continue;
136 138
             }
137 139
 
138 140
             $reflectionMethods[$method->name] = $method;
139 141
             self::assertArrayHasKey($method->name, $methods);
140 142
 
141
-            if (!$method->hasReturnType()) {
143
+            if (!$method->hasReturnType())
144
+            {
142 145
                 self::assertNull($methods[$method->name]['hint']);
143
-            } else {
146
+            }
147
+            else
148
+            {
144 149
                 self::assertEquals($methods[$method->name]['hint'], $method->getReturnType()->getName());
145 150
             }
146 151
         }
@@ -180,8 +185,10 @@  discard block
 block discarded – undo
180 185
         ];
181 186
 
182 187
         $reflectionMethods = [];
183
-        foreach ($reflection->getMethods() as $method) {
184
-            if ($method->getDeclaringClass()->name !== $reflection->name) {
188
+        foreach ($reflection->getMethods() as $method)
189
+        {
190
+            if ($method->getDeclaringClass()->name !== $reflection->name)
191
+            {
185 192
                 continue;
186 193
             }
187 194
             $reflectionMethods[$method->name] = $method;
Please login to merge, or discard this patch.
src/Models/tests/DataEntityTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         self::assertSame([], $entity->getValue());
69 69
 
70 70
         $entity['a'] = 90;
71
-        foreach ($entity as $key => $value) {
71
+        foreach ($entity as $key => $value){
72 72
             self::assertSame('a', $key);
73 73
             self::assertSame(90, $value);
74 74
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,8 @@
 block discarded – undo
68 68
         self::assertSame([], $entity->getValue());
69 69
 
70 70
         $entity['a'] = 90;
71
-        foreach ($entity as $key => $value) {
71
+        foreach ($entity as $key => $value)
72
+        {
72 73
             self::assertSame('a', $key);
73 74
             self::assertSame(90, $value);
74 75
         }
Please login to merge, or discard this patch.
src/Snapshots/tests/FileSnapshotTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     {
21 21
         $this->files = new Files();
22 22
         $this->fileSnapshot = new FileSnapshot(
23
-            __DIR__ . '/snapshots',
23
+            __DIR__.'/snapshots',
24 24
             1,
25 25
             Verbosity::DEBUG,
26 26
             new PlainRenderer(),
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     protected function tearDown(): void
32 32
     {
33
-        $this->files->deleteDirectory(__DIR__ . '/snapshots');
33
+        $this->files->deleteDirectory(__DIR__.'/snapshots');
34 34
     }
35 35
 
36 36
     public function testCreate(): void
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         self::assertStringContainsString('message', $s->getMessage());
45 45
         self::assertStringContainsString(__FILE__, $s->getMessage());
46 46
         self::assertStringContainsString('38', $s->getMessage());
47
-        self::assertCount(1, $this->files->getFiles(__DIR__ . '/snapshots'));
47
+        self::assertCount(1, $this->files->getFiles(__DIR__.'/snapshots'));
48 48
     }
49 49
 
50 50
     public function testCreateBiggerThanMaxFiles(): void
@@ -58,6 +58,6 @@  discard block
 block discarded – undo
58 58
         self::assertSame($e, $s->getException());
59 59
         self::assertSame($e2, $s2->getException());
60 60
 
61
-        self::assertCount(1, $this->files->getFiles(__DIR__ . '/snapshots'));
61
+        self::assertCount(1, $this->files->getFiles(__DIR__.'/snapshots'));
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
src/Cookies/tests/CookieTest.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,9 +110,12 @@
 block discarded – undo
110 110
         $cookie = new Cookie('', '', 0, '', '', $secure, false, $sameSite);
111 111
         self::assertSame($expected, $cookie->getSameSite());
112 112
 
113
-        if ($expected === null) {
113
+        if ($expected === null)
114
+        {
114 115
             self::assertStringNotContainsString('SameSite=', $cookie->createHeader());
115
-        } else {
116
+        }
117
+        else
118
+        {
116 119
             self::assertStringContainsString("SameSite=$expected", $cookie->createHeader());
117 120
         }
118 121
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             true,
113 113
         );
114 114
 
115
-        self::assertSame($cookie->createHeader(), (string) $cookie);
115
+        self::assertSame($cookie->createHeader(), (string)$cookie);
116 116
         self::assertStringContainsString('cookie=value;', $cookie->createHeader());
117 117
 
118 118
         self::assertStringContainsString('Max-Age=100; Path=/; Domain=.domain.com; Secure; HttpOnly', $cookie->createHeader());
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
         $cookie = new Cookie('', '', 0, '', '', $secure, false, $sameSite);
125 125
         self::assertSame($expected, $cookie->getSameSite());
126 126
 
127
-        if ($expected === null) {
127
+        if ($expected === null){
128 128
             self::assertStringNotContainsString('SameSite=', $cookie->createHeader());
129
-        } else {
129
+        }else{
130 130
             self::assertStringContainsString("SameSite=$expected", $cookie->createHeader());
131 131
         }
132 132
     }
Please login to merge, or discard this patch.
src/Translator/tests/LoaderTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     public function testHasLocale(): void
19 19
     {
20 20
         $loader = new CatalogueLoader(new TranslatorConfig([
21
-            'directory' => __DIR__ . '/fixtures/locales/',
21
+            'directory' => __DIR__.'/fixtures/locales/',
22 22
         ]));
23 23
 
24 24
         self::assertTrue($loader->hasLocale('ru'));
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
         self::assertFalse($loader->hasLocale('FR'));
28 28
 
29 29
         $loader = new CatalogueLoader(new TranslatorConfig([
30
-            'directory' => __DIR__ . '/fixtures/locales/',
31
-            'directories' => [__DIR__ . '/fixtures/additional'],
30
+            'directory' => __DIR__.'/fixtures/locales/',
31
+            'directories' => [__DIR__.'/fixtures/additional'],
32 32
         ]));
33 33
 
34 34
         self::assertTrue($loader->hasLocale('ru'));
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function testGetLocales(): void
41 41
     {
42 42
         $loader = new CatalogueLoader(new TranslatorConfig([
43
-            'directory' => __DIR__ . '/fixtures/locales/',
43
+            'directory' => __DIR__.'/fixtures/locales/',
44 44
         ]));
45 45
 
46 46
         $compared = $loader->getLocales();
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     public function testGetLocalesWithAdditionalDirectories(): void
55 55
     {
56 56
         $loader = new CatalogueLoader(new TranslatorConfig([
57
-            'directory' => __DIR__ . '/fixtures/locales/',
58
-            'directories' => [__DIR__ . '/fixtures/additional'],
57
+            'directory' => __DIR__.'/fixtures/locales/',
58
+            'directories' => [__DIR__.'/fixtures/additional'],
59 59
         ]));
60 60
 
61 61
         $compared = $loader->getLocales();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function testLoadCatalogue(): void
70 70
     {
71 71
         $loader = new CatalogueLoader(new TranslatorConfig([
72
-            'directory' => __DIR__ . '/fixtures/locales/',
72
+            'directory' => __DIR__.'/fixtures/locales/',
73 73
             'loaders'   => [
74 74
                 'php' => PhpFileLoader::class,
75 75
                 'po'  => PoFileLoader::class,
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
     public function testLoadCatalogueWithAdditionalDirectories(): void
106 106
     {
107 107
         $loader = new CatalogueLoader(new TranslatorConfig([
108
-            'directory' => __DIR__ . '/fixtures/locales/',
109
-            'directories' => [__DIR__ . '/fixtures/additional'],
108
+            'directory' => __DIR__.'/fixtures/locales/',
109
+            'directories' => [__DIR__.'/fixtures/additional'],
110 110
             'loaders'   => [
111 111
                 'php' => PhpFileLoader::class,
112 112
                 'po'  => PoFileLoader::class,
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     public function testApplicationTranslationShouldOverrideAdditionalTranslations(): void
128 128
     {
129 129
         $loader = new CatalogueLoader(new TranslatorConfig([
130
-            'directory' => __DIR__ . '/fixtures/locales/',
131
-            'directories' => [__DIR__ . '/fixtures/additional'],
130
+            'directory' => __DIR__.'/fixtures/locales/',
131
+            'directories' => [__DIR__.'/fixtures/additional'],
132 132
             'loaders'   => [
133 133
                 'php' => PhpFileLoader::class,
134 134
                 'po'  => PoFileLoader::class,
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     public function testLoadCatalogueNoLoader(): void
146 146
     {
147 147
         $loader = new CatalogueLoader(new TranslatorConfig([
148
-            'directory' => __DIR__ . '/fixtures/locales/',
148
+            'directory' => __DIR__.'/fixtures/locales/',
149 149
             'loaders'   => [
150 150
                 'php' => PhpFileLoader::class,
151 151
             ],
Please login to merge, or discard this patch.