Test Failed
Pull Request — master (#945)
by butschster
08:00
created
src/Files/src/Files.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     /**
24 24
      * Default file mode for this manager.
25 25
      */
26
-    public const DEFAULT_FILE_MODE = self::READONLY;
26
+    public const DEFAULT_FILE_MODE = self::readonly;
27 27
 
28 28
     /**
29 29
      * Files to be removed when component destructed.
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function __destruct()
38 38
     {
39
-        foreach ($this->destructFiles as $filename) {
39
+        foreach ($this->destructFiles as $filename){
40 40
             $this->delete($filename);
41 41
         }
42 42
     }
@@ -49,30 +49,30 @@  discard block
 block discarded – undo
49 49
         int $mode = null,
50 50
         bool $recursivePermissions = true
51 51
     ): bool {
52
-        if (empty($mode)) {
52
+        if (empty($mode)){
53 53
             $mode = self::DEFAULT_FILE_MODE;
54 54
         }
55 55
 
56 56
         //Directories always executable
57 57
         $mode |= 0o111;
58
-        if (\is_dir($directory)) {
58
+        if (\is_dir($directory)){
59 59
             //Exists :(
60 60
             return $this->setPermissions($directory, $mode);
61 61
         }
62 62
 
63
-        if (!$recursivePermissions) {
63
+        if (!$recursivePermissions){
64 64
             return \mkdir($directory, $mode, true);
65 65
         }
66 66
 
67 67
         $directoryChain = [\basename($directory)];
68 68
 
69 69
         $baseDirectory = $directory;
70
-        while (!\is_dir($baseDirectory = \dirname($baseDirectory))) {
70
+        while (!\is_dir($baseDirectory = \dirname($baseDirectory))){
71 71
             $directoryChain[] = \basename($baseDirectory);
72 72
         }
73 73
 
74
-        foreach (\array_reverse($directoryChain) as $dir) {
75
-            if (!mkdir($baseDirectory = \sprintf('%s/%s', $baseDirectory, $dir))) {
74
+        foreach (\array_reverse($directoryChain) as $dir){
75
+            if (!mkdir($baseDirectory = \sprintf('%s/%s', $baseDirectory, $dir))){
76 76
                 return false;
77 77
             }
78 78
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function read(string $filename): string
86 86
     {
87
-        if (!$this->exists($filename)) {
87
+        if (!$this->exists($filename)){
88 88
             throw new FileNotFoundException($filename);
89 89
         }
90 90
 
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
     ): bool {
104 104
         $mode ??= self::DEFAULT_FILE_MODE;
105 105
 
106
-        try {
107
-            if ($ensureDirectory) {
106
+        try{
107
+            if ($ensureDirectory){
108 108
                 $this->ensureDirectory(\dirname($filename), $mode);
109 109
             }
110 110
 
111
-            if ($this->exists($filename)) {
111
+            if ($this->exists($filename)){
112 112
                 //Forcing mode for existed file
113 113
                 $this->setPermissions($filename, $mode);
114 114
             }
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
                 $append ? FILE_APPEND | LOCK_EX : LOCK_EX
120 120
             );
121 121
 
122
-            if ($result !== false) {
122
+            if ($result !== false){
123 123
                 //Forcing mode after file creation
124 124
                 $this->setPermissions($filename, $mode);
125 125
             }
126
-        } catch (\Exception $e) {
127
-            throw new WriteErrorException($e->getMessage(), (int) $e->getCode(), $e);
126
+        }catch (\Exception $e){
127
+            throw new WriteErrorException($e->getMessage(), (int)$e->getCode(), $e);
128 128
         }
129 129
 
130 130
         return $result !== false;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
     public function delete(string $filename): bool
143 143
     {
144
-        if ($this->exists($filename)) {
144
+        if ($this->exists($filename)){
145 145
             $result = \unlink($filename);
146 146
 
147 147
             //Wiping out changes in local file cache
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function deleteDirectory(string $directory, bool $contentOnly = false): bool
162 162
     {
163
-        if (!$this->isDirectory($directory)) {
163
+        if (!$this->isDirectory($directory)){
164 164
             throw new FilesException(\sprintf('Undefined or invalid directory %s', $directory));
165 165
         }
166 166
 
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
             \RecursiveIteratorIterator::CHILD_FIRST
170 170
         );
171 171
 
172
-        foreach ($files as $file) {
173
-            if ($file->isDir()) {
172
+        foreach ($files as $file){
173
+            if ($file->isDir()){
174 174
                 \rmdir($file->getRealPath());
175
-            } else {
175
+            }else{
176 176
                 $this->delete($file->getRealPath());
177 177
             }
178 178
         }
179 179
 
180
-        if (!$contentOnly) {
180
+        if (!$contentOnly){
181 181
             return \rmdir($directory);
182 182
         }
183 183
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     public function move(string $filename, string $destination): bool
188 188
     {
189
-        if (!$this->exists($filename)) {
189
+        if (!$this->exists($filename)){
190 190
             throw new FileNotFoundException($filename);
191 191
         }
192 192
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
     public function copy(string $filename, string $destination): bool
197 197
     {
198
-        if (!$this->exists($filename)) {
198
+        if (!$this->exists($filename)){
199 199
             throw new FileNotFoundException($filename);
200 200
         }
201 201
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
     public function touch(string $filename, int $mode = null): bool
206 206
     {
207
-        if (!\touch($filename)) {
207
+        if (!\touch($filename)){
208 208
             return false;
209 209
         }
210 210
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
     public function size(string $filename): int
220 220
     {
221
-        if (!$this->exists($filename)) {
221
+        if (!$this->exists($filename)){
222 222
             throw new FileNotFoundException($filename);
223 223
         }
224 224
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
     public function md5(string $filename): string
234 234
     {
235
-        if (!$this->exists($filename)) {
235
+        if (!$this->exists($filename)){
236 236
             throw new FileNotFoundException($filename);
237 237
         }
238 238
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
     public function time(string $filename): int
243 243
     {
244
-        if (!$this->exists($filename)) {
244
+        if (!$this->exists($filename)){
245 245
             throw new FileNotFoundException($filename);
246 246
         }
247 247
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 
261 261
     public function getPermissions(string $filename): int
262 262
     {
263
-        if (!$this->exists($filename)) {
263
+        if (!$this->exists($filename)){
264 264
             throw new FileNotFoundException($filename);
265 265
         }
266 266
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
     public function setPermissions(string $filename, int $mode): bool
271 271
     {
272
-        if (\is_dir($filename)) {
272
+        if (\is_dir($filename)){
273 273
             //Directories must always be executable (i.e. 664 for dir => 775)
274 274
             $mode |= 0111;
275 275
         }
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
     public function getFiles(string $location, string $pattern = null): array
281 281
     {
282 282
         $result = [];
283
-        foreach ($this->filesIterator($location, $pattern) as $filename) {
284
-            if ($this->isDirectory($filename->getPathname())) {
285
-                $result = \array_merge($result, $this->getFiles($filename . DIRECTORY_SEPARATOR));
283
+        foreach ($this->filesIterator($location, $pattern) as $filename){
284
+            if ($this->isDirectory($filename->getPathname())){
285
+                $result = \array_merge($result, $this->getFiles($filename.DIRECTORY_SEPARATOR));
286 286
 
287 287
                 continue;
288 288
             }
@@ -295,13 +295,13 @@  discard block
 block discarded – undo
295 295
 
296 296
     public function tempFilename(string $extension = '', string $location = null): string
297 297
     {
298
-        if (empty($location)) {
298
+        if (empty($location)){
299 299
             $location = \sys_get_temp_dir();
300 300
         }
301 301
 
302 302
         $filename = \tempnam($location, 'spiral');
303 303
 
304
-        if (!empty($extension)) {
304
+        if (!empty($extension)){
305 305
             $old = $filename;
306 306
             $filename = \sprintf('%s.%s', $filename, $extension);
307 307
             \rename($old, $filename);
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $path = \str_replace(['//', '\\'], '/', $path);
317 317
 
318 318
         //Potentially open links and ../ type directories?
319
-        return \rtrim($path, '/') . ($asDirectory ? '/' : '');
319
+        return \rtrim($path, '/').($asDirectory ? '/' : '');
320 320
     }
321 321
 
322 322
     /**
@@ -331,21 +331,21 @@  discard block
 block discarded – undo
331 331
         $path = \explode('/', $path);
332 332
         $relative = $path;
333 333
 
334
-        foreach ($from as $depth => $dir) {
334
+        foreach ($from as $depth => $dir){
335 335
             //Find first non-matching dir
336
-            if ($dir === $path[$depth]) {
336
+            if ($dir === $path[$depth]){
337 337
                 //Ignore this directory
338 338
                 \array_shift($relative);
339
-            } else {
339
+            }else{
340 340
                 //Get number of remaining dirs to $from
341 341
                 $remaining = \count($from) - $depth;
342
-                if ($remaining > 1) {
342
+                if ($remaining > 1){
343 343
                     //Add traversals up to first matching directory
344 344
                     $padLength = (\count($relative) + $remaining - 1) * -1;
345 345
                     $relative = \array_pad($relative, $padLength, '..');
346 346
                     break;
347 347
                 }
348
-                $relative[0] = './' . $relative[0];
348
+                $relative[0] = './'.$relative[0];
349 349
             }
350 350
         }
351 351
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
     private function filesIterator(string $location, string $pattern = null): \GlobIterator
356 356
     {
357 357
         $pattern ??= '*';
358
-        $regexp = \rtrim($location, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . \ltrim($pattern, DIRECTORY_SEPARATOR);
358
+        $regexp = \rtrim($location, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.\ltrim($pattern, DIRECTORY_SEPARATOR);
359 359
 
360 360
         return new \GlobIterator($regexp);
361 361
     }
Please login to merge, or discard this patch.
Braces   +73 added lines, -35 removed lines patch added patch discarded remove patch
@@ -36,7 +36,8 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public function __destruct()
38 38
     {
39
-        foreach ($this->destructFiles as $filename) {
39
+        foreach ($this->destructFiles as $filename)
40
+        {
40 41
             $this->delete($filename);
41 42
         }
42 43
     }
@@ -49,30 +50,36 @@  discard block
 block discarded – undo
49 50
         int $mode = null,
50 51
         bool $recursivePermissions = true
51 52
     ): bool {
52
-        if (empty($mode)) {
53
+        if (empty($mode))
54
+        {
53 55
             $mode = self::DEFAULT_FILE_MODE;
54 56
         }
55 57
 
56 58
         //Directories always executable
57 59
         $mode |= 0o111;
58
-        if (\is_dir($directory)) {
60
+        if (\is_dir($directory))
61
+        {
59 62
             //Exists :(
60 63
             return $this->setPermissions($directory, $mode);
61 64
         }
62 65
 
63
-        if (!$recursivePermissions) {
66
+        if (!$recursivePermissions)
67
+        {
64 68
             return \mkdir($directory, $mode, true);
65 69
         }
66 70
 
67 71
         $directoryChain = [\basename($directory)];
68 72
 
69 73
         $baseDirectory = $directory;
70
-        while (!\is_dir($baseDirectory = \dirname($baseDirectory))) {
74
+        while (!\is_dir($baseDirectory = \dirname($baseDirectory)))
75
+        {
71 76
             $directoryChain[] = \basename($baseDirectory);
72 77
         }
73 78
 
74
-        foreach (\array_reverse($directoryChain) as $dir) {
75
-            if (!mkdir($baseDirectory = \sprintf('%s/%s', $baseDirectory, $dir))) {
79
+        foreach (\array_reverse($directoryChain) as $dir)
80
+        {
81
+            if (!mkdir($baseDirectory = \sprintf('%s/%s', $baseDirectory, $dir)))
82
+            {
76 83
                 return false;
77 84
             }
78 85
 
@@ -84,7 +91,8 @@  discard block
 block discarded – undo
84 91
 
85 92
     public function read(string $filename): string
86 93
     {
87
-        if (!$this->exists($filename)) {
94
+        if (!$this->exists($filename))
95
+        {
88 96
             throw new FileNotFoundException($filename);
89 97
         }
90 98
 
@@ -103,12 +111,15 @@  discard block
 block discarded – undo
103 111
     ): bool {
104 112
         $mode ??= self::DEFAULT_FILE_MODE;
105 113
 
106
-        try {
107
-            if ($ensureDirectory) {
114
+        try
115
+        {
116
+            if ($ensureDirectory)
117
+            {
108 118
                 $this->ensureDirectory(\dirname($filename), $mode);
109 119
             }
110 120
 
111
-            if ($this->exists($filename)) {
121
+            if ($this->exists($filename))
122
+            {
112 123
                 //Forcing mode for existed file
113 124
                 $this->setPermissions($filename, $mode);
114 125
             }
@@ -119,11 +130,14 @@  discard block
 block discarded – undo
119 130
                 $append ? FILE_APPEND | LOCK_EX : LOCK_EX
120 131
             );
121 132
 
122
-            if ($result !== false) {
133
+            if ($result !== false)
134
+            {
123 135
                 //Forcing mode after file creation
124 136
                 $this->setPermissions($filename, $mode);
125 137
             }
126
-        } catch (\Exception $e) {
138
+        }
139
+        catch (\Exception $e)
140
+        {
127 141
             throw new WriteErrorException($e->getMessage(), (int) $e->getCode(), $e);
128 142
         }
129 143
 
@@ -141,7 +155,8 @@  discard block
 block discarded – undo
141 155
 
142 156
     public function delete(string $filename): bool
143 157
     {
144
-        if ($this->exists($filename)) {
158
+        if ($this->exists($filename))
159
+        {
145 160
             $result = \unlink($filename);
146 161
 
147 162
             //Wiping out changes in local file cache
@@ -160,7 +175,8 @@  discard block
 block discarded – undo
160 175
      */
161 176
     public function deleteDirectory(string $directory, bool $contentOnly = false): bool
162 177
     {
163
-        if (!$this->isDirectory($directory)) {
178
+        if (!$this->isDirectory($directory))
179
+        {
164 180
             throw new FilesException(\sprintf('Undefined or invalid directory %s', $directory));
165 181
         }
166 182
 
@@ -169,15 +185,20 @@  discard block
 block discarded – undo
169 185
             \RecursiveIteratorIterator::CHILD_FIRST
170 186
         );
171 187
 
172
-        foreach ($files as $file) {
173
-            if ($file->isDir()) {
188
+        foreach ($files as $file)
189
+        {
190
+            if ($file->isDir())
191
+            {
174 192
                 \rmdir($file->getRealPath());
175
-            } else {
193
+            }
194
+            else
195
+            {
176 196
                 $this->delete($file->getRealPath());
177 197
             }
178 198
         }
179 199
 
180
-        if (!$contentOnly) {
200
+        if (!$contentOnly)
201
+        {
181 202
             return \rmdir($directory);
182 203
         }
183 204
 
@@ -186,7 +207,8 @@  discard block
 block discarded – undo
186 207
 
187 208
     public function move(string $filename, string $destination): bool
188 209
     {
189
-        if (!$this->exists($filename)) {
210
+        if (!$this->exists($filename))
211
+        {
190 212
             throw new FileNotFoundException($filename);
191 213
         }
192 214
 
@@ -195,7 +217,8 @@  discard block
 block discarded – undo
195 217
 
196 218
     public function copy(string $filename, string $destination): bool
197 219
     {
198
-        if (!$this->exists($filename)) {
220
+        if (!$this->exists($filename))
221
+        {
199 222
             throw new FileNotFoundException($filename);
200 223
         }
201 224
 
@@ -204,7 +227,8 @@  discard block
 block discarded – undo
204 227
 
205 228
     public function touch(string $filename, int $mode = null): bool
206 229
     {
207
-        if (!\touch($filename)) {
230
+        if (!\touch($filename))
231
+        {
208 232
             return false;
209 233
         }
210 234
 
@@ -218,7 +242,8 @@  discard block
 block discarded – undo
218 242
 
219 243
     public function size(string $filename): int
220 244
     {
221
-        if (!$this->exists($filename)) {
245
+        if (!$this->exists($filename))
246
+        {
222 247
             throw new FileNotFoundException($filename);
223 248
         }
224 249
 
@@ -232,7 +257,8 @@  discard block
 block discarded – undo
232 257
 
233 258
     public function md5(string $filename): string
234 259
     {
235
-        if (!$this->exists($filename)) {
260
+        if (!$this->exists($filename))
261
+        {
236 262
             throw new FileNotFoundException($filename);
237 263
         }
238 264
 
@@ -241,7 +267,8 @@  discard block
 block discarded – undo
241 267
 
242 268
     public function time(string $filename): int
243 269
     {
244
-        if (!$this->exists($filename)) {
270
+        if (!$this->exists($filename))
271
+        {
245 272
             throw new FileNotFoundException($filename);
246 273
         }
247 274
 
@@ -260,7 +287,8 @@  discard block
 block discarded – undo
260 287
 
261 288
     public function getPermissions(string $filename): int
262 289
     {
263
-        if (!$this->exists($filename)) {
290
+        if (!$this->exists($filename))
291
+        {
264 292
             throw new FileNotFoundException($filename);
265 293
         }
266 294
 
@@ -269,7 +297,8 @@  discard block
 block discarded – undo
269 297
 
270 298
     public function setPermissions(string $filename, int $mode): bool
271 299
     {
272
-        if (\is_dir($filename)) {
300
+        if (\is_dir($filename))
301
+        {
273 302
             //Directories must always be executable (i.e. 664 for dir => 775)
274 303
             $mode |= 0111;
275 304
         }
@@ -280,8 +309,10 @@  discard block
 block discarded – undo
280 309
     public function getFiles(string $location, string $pattern = null): array
281 310
     {
282 311
         $result = [];
283
-        foreach ($this->filesIterator($location, $pattern) as $filename) {
284
-            if ($this->isDirectory($filename->getPathname())) {
312
+        foreach ($this->filesIterator($location, $pattern) as $filename)
313
+        {
314
+            if ($this->isDirectory($filename->getPathname()))
315
+            {
285 316
                 $result = \array_merge($result, $this->getFiles($filename . DIRECTORY_SEPARATOR));
286 317
 
287 318
                 continue;
@@ -295,13 +326,15 @@  discard block
 block discarded – undo
295 326
 
296 327
     public function tempFilename(string $extension = '', string $location = null): string
297 328
     {
298
-        if (empty($location)) {
329
+        if (empty($location))
330
+        {
299 331
             $location = \sys_get_temp_dir();
300 332
         }
301 333
 
302 334
         $filename = \tempnam($location, 'spiral');
303 335
 
304
-        if (!empty($extension)) {
336
+        if (!empty($extension))
337
+        {
305 338
             $old = $filename;
306 339
             $filename = \sprintf('%s.%s', $filename, $extension);
307 340
             \rename($old, $filename);
@@ -331,15 +364,20 @@  discard block
 block discarded – undo
331 364
         $path = \explode('/', $path);
332 365
         $relative = $path;
333 366
 
334
-        foreach ($from as $depth => $dir) {
367
+        foreach ($from as $depth => $dir)
368
+        {
335 369
             //Find first non-matching dir
336
-            if ($dir === $path[$depth]) {
370
+            if ($dir === $path[$depth])
371
+            {
337 372
                 //Ignore this directory
338 373
                 \array_shift($relative);
339
-            } else {
374
+            }
375
+            else
376
+            {
340 377
                 //Get number of remaining dirs to $from
341 378
                 $remaining = \count($from) - $depth;
342
-                if ($remaining > 1) {
379
+                if ($remaining > 1)
380
+                {
343 381
                     //Add traversals up to first matching directory
344 382
                     $padLength = (\count($relative) + $remaining - 1) * -1;
345 383
                     $relative = \array_pad($relative, $padLength, '..');
Please login to merge, or discard this patch.
src/Files/src/FilesInterface.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public const RUNTIME = 0666;
24 24
 
25 25
     //Only owner can write
26
-    public const READONLY = 0644;
26
+    public const readonly = 0644;
27 27
 
28 28
     /**
29 29
      * Few size constants for better size manipulations.
Please login to merge, or discard this patch.
src/Cookies/src/Cookie/SameSite.php 3 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     public const NONE   = 'None';
12 12
 
13 13
     private const VALUES  = [self::STRICT, self::LAX, self::NONE];
14
-    private const DEFAULT = self::LAX;
14
+    private const default = self::LAX;
15 15
 
16 16
     private ?string $sameSite = null;
17 17
 
@@ -36,6 +36,6 @@  discard block
 block discarded – undo
36 36
             return null;
37 37
         }
38 38
 
39
-        return ($sameSite === self::NONE && !$secure) ? self::DEFAULT : $sameSite;
39
+        return ($sameSite === self::NONE && !$secure) ? self::default : $sameSite;
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
 
28 28
     private function defineValue(?string $sameSite, bool $secure): ?string
29 29
     {
30
-        if ($sameSite === null) {
30
+        if ($sameSite === null){
31 31
             return null;
32 32
         }
33 33
 
34 34
         $sameSite = \ucfirst(\strtolower($sameSite));
35
-        if (!\in_array($sameSite, self::VALUES, true)) {
35
+        if (!\in_array($sameSite, self::VALUES, true)){
36 36
             return null;
37 37
         }
38 38
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,14 @@
 block discarded – undo
27 27
 
28 28
     private function defineValue(?string $sameSite, bool $secure): ?string
29 29
     {
30
-        if ($sameSite === null) {
30
+        if ($sameSite === null)
31
+        {
31 32
             return null;
32 33
         }
33 34
 
34 35
         $sameSite = \ucfirst(\strtolower($sameSite));
35
-        if (!\in_array($sameSite, self::VALUES, true)) {
36
+        if (!\in_array($sameSite, self::VALUES, true))
37
+        {
36 38
             return null;
37 39
         }
38 40
 
Please login to merge, or discard this patch.
src/AuthHttp/src/Middleware/AuthMiddleware.php 2 patches
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,14 +70,17 @@  discard block
 block discarded – undo
70 70
 
71 71
     private function initContext(Request $request, AuthContextInterface $authContext): AuthContextInterface
72 72
     {
73
-        foreach ($this->transportRegistry->getTransports() as $name => $transport) {
73
+        foreach ($this->transportRegistry->getTransports() as $name => $transport)
74
+        {
74 75
             $tokenID = $transport->fetchToken($request);
75
-            if ($tokenID === null) {
76
+            if ($tokenID === null)
77
+            {
76 78
                 continue;
77 79
             }
78 80
 
79 81
             $token = $this->tokenStorage->load($tokenID);
80
-            if ($token === null) {
82
+            if ($token === null)
83
+            {
81 84
                 continue;
82 85
             }
83 86
 
@@ -91,13 +94,15 @@  discard block
 block discarded – undo
91 94
 
92 95
     private function closeContext(Request $request, Response $response, AuthContextInterface $authContext): Response
93 96
     {
94
-        if ($authContext->getToken() === null) {
97
+        if ($authContext->getToken() === null)
98
+        {
95 99
             return $response;
96 100
         }
97 101
 
98 102
         $transport = $this->transportRegistry->getTransport($authContext->getTransport());
99 103
 
100
-        if ($authContext->isClosed()) {
104
+        if ($authContext->isClosed())
105
+        {
101 106
             $this->tokenStorage->delete($authContext->getToken());
102 107
 
103 108
             return $transport->removeToken(
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         private readonly TokenStorageInterface $tokenStorage,
30 30
         private readonly TransportRegistry $transportRegistry,
31 31
         private readonly ?EventDispatcherInterface $eventDispatcher = null
32
-    ) {
32
+    ){
33 33
     }
34 34
 
35 35
     /**
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 
50 50
     private function initContext(Request $request, AuthContextInterface $authContext): AuthContextInterface
51 51
     {
52
-        foreach ($this->transportRegistry->getTransports() as $name => $transport) {
52
+        foreach ($this->transportRegistry->getTransports() as $name => $transport){
53 53
             $tokenID = $transport->fetchToken($request);
54
-            if ($tokenID === null) {
54
+            if ($tokenID === null){
55 55
                 continue;
56 56
             }
57 57
 
58 58
             $token = $this->tokenStorage->load($tokenID);
59
-            if ($token === null) {
59
+            if ($token === null){
60 60
                 continue;
61 61
             }
62 62
 
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 
71 71
     private function closeContext(Request $request, Response $response, AuthContextInterface $authContext): Response
72 72
     {
73
-        if ($authContext->getToken() === null) {
73
+        if ($authContext->getToken() === null){
74 74
             return $response;
75 75
         }
76 76
 
77 77
         $transport = $this->transportRegistry->getTransport($authContext->getTransport());
78 78
 
79
-        if ($authContext->isClosed()) {
79
+        if ($authContext->isClosed()){
80 80
             $this->tokenStorage->delete($authContext->getToken());
81 81
 
82 82
             return $transport->removeToken(
Please login to merge, or discard this patch.
src/Broadcasting/src/BroadcastManager.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@
 block discarded – undo
30 30
         // Replaces alias with real storage name
31 31
         $name = $this->config->getAliases()[$name] ?? $name;
32 32
 
33
-        if (isset($this->connections[$name])) {
33
+        if (isset($this->connections[$name]))
34
+        {
34 35
             return $this->connections[$name];
35 36
         }
36 37
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     public function __construct(
17 17
         private readonly FactoryInterface $factory,
18 18
         private readonly BroadcastConfig $config
19
-    ) {
19
+    ){
20 20
     }
21 21
 
22 22
     public function connection(?string $name = null): BroadcastInterface
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         // Replaces alias with real storage name
27 27
         $name = $this->config->getAliases()[$name] ?? $name;
28 28
 
29
-        if (isset($this->connections[$name])) {
29
+        if (isset($this->connections[$name])){
30 30
             return $this->connections[$name];
31 31
         }
32 32
 
Please login to merge, or discard this patch.
src/Http/src/Config/HttpConfig.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@
 block discarded – undo
58 58
      */
59 59
     public function getChunkSize(): ?int
60 60
     {
61
-        if (\is_null($this->config['chunkSize']) || (int) $this->config['chunkSize'] < 0) {
61
+        if (\is_null($this->config['chunkSize']) || (int)$this->config['chunkSize'] < 0){
62 62
             return null;
63 63
         }
64 64
 
65
-        return (int) $this->config['chunkSize'];
65
+        return (int)$this->config['chunkSize'];
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function getChunkSize(): ?int
60 60
     {
61
-        if (\is_null($this->config['chunkSize']) || (int) $this->config['chunkSize'] < 0) {
61
+        if (\is_null($this->config['chunkSize']) || (int) $this->config['chunkSize'] < 0)
62
+        {
62 63
             return null;
63 64
         }
64 65
 
Please login to merge, or discard this patch.
builder/ProcessParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function __construct(
14 14
         private readonly ProcessRunner $processRunner
15
-    ) {
15
+    ){
16 16
     }
17 17
 
18 18
     /**
Please login to merge, or discard this patch.
builder/ValidateVersionReleaseWorker.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
     public function __construct(
14 14
         private readonly TagParserInterface $parser,
15 15
         private ?string $gitDirectory = null
16
-    ) {
17
-        if ($gitDirectory === null) {
16
+    ){
17
+        if ($gitDirectory === null){
18 18
             $this->gitDirectory = \dirname(__DIR__);
19 19
         }
20 20
     }
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
         $mostRecentVersion = $this->findMostRecentVersion($version);
33 33
 
34 34
         // no tag yet
35
-        if ($mostRecentVersion === null) {
35
+        if ($mostRecentVersion === null){
36 36
             return;
37 37
         }
38 38
 
39 39
         // validation
40 40
         $mostRecentVersion = new Version(\strtolower($mostRecentVersion));
41
-        if ($version->isGreaterThan($mostRecentVersion)) {
41
+        if ($version->isGreaterThan($mostRecentVersion)){
42 42
             return;
43 43
         }
44 44
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
     private function findMostRecentVersion(Version $version): ?string
53 53
     {
54 54
         $tags = [];
55
-        foreach ($this->parser->parse($this->gitDirectory) as $tag) {
55
+        foreach ($this->parser->parse($this->gitDirectory) as $tag){
56 56
             $tag = new Version(\strtolower($tag));
57 57
 
58 58
             // all previous major versions
59
-            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue()) {
59
+            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue()){
60 60
                 $tags[] = $tag;
61 61
             }
62 62
 
63 63
             // all minor versions up to the requested in the requested major version
64
-            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue()) {
65
-                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue()) {
64
+            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue()){
65
+                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue()){
66 66
                     $tags[] = $tag;
67 67
                 }
68 68
             }
69 69
         }
70 70
 
71
-        if ($tags === []) {
71
+        if ($tags === []){
72 72
             return null;
73 73
         }
74 74
 
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,7 +14,8 @@  discard block
 block discarded – undo
14 14
         private readonly TagParserInterface $parser,
15 15
         private ?string $gitDirectory = null
16 16
     ) {
17
-        if ($gitDirectory === null) {
17
+        if ($gitDirectory === null)
18
+        {
18 19
             $this->gitDirectory = \dirname(__DIR__);
19 20
         }
20 21
     }
@@ -32,13 +33,15 @@  discard block
 block discarded – undo
32 33
         $mostRecentVersion = $this->findMostRecentVersion($version);
33 34
 
34 35
         // no tag yet
35
-        if ($mostRecentVersion === null) {
36
+        if ($mostRecentVersion === null)
37
+        {
36 38
             return;
37 39
         }
38 40
 
39 41
         // validation
40 42
         $mostRecentVersion = new Version(\strtolower($mostRecentVersion));
41
-        if ($version->isGreaterThan($mostRecentVersion)) {
43
+        if ($version->isGreaterThan($mostRecentVersion))
44
+        {
42 45
             return;
43 46
         }
44 47
 
@@ -52,23 +55,28 @@  discard block
 block discarded – undo
52 55
     private function findMostRecentVersion(Version $version): ?string
53 56
     {
54 57
         $tags = [];
55
-        foreach ($this->parser->parse($this->gitDirectory) as $tag) {
58
+        foreach ($this->parser->parse($this->gitDirectory) as $tag)
59
+        {
56 60
             $tag = new Version(\strtolower($tag));
57 61
 
58 62
             // all previous major versions
59
-            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue()) {
63
+            if ($version->getMajor()->getValue() > $tag->getMajor()->getValue())
64
+            {
60 65
                 $tags[] = $tag;
61 66
             }
62 67
 
63 68
             // all minor versions up to the requested in the requested major version
64
-            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue()) {
65
-                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue()) {
69
+            if ($version->getMajor()->getValue() === $tag->getMajor()->getValue())
70
+            {
71
+                if ($version->getMinor()->getValue() >= $tag->getMinor()->getValue())
72
+                {
66 73
                     $tags[] = $tag;
67 74
                 }
68 75
             }
69 76
         }
70 77
 
71
-        if ($tags === []) {
78
+        if ($tags === [])
79
+        {
72 80
             return null;
73 81
         }
74 82
 
Please login to merge, or discard this patch.
src/Session/src/Config/SessionConfig.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@
 block discarded – undo
43 43
      */
44 44
     public function getHandler(): ?Autowire
45 45
     {
46
-        if (empty($this->config['handler'])) {
46
+        if (empty($this->config['handler'])){
47 47
             return null;
48 48
         }
49 49
 
50
-        if ($this->config['handler'] instanceof Autowire) {
50
+        if ($this->config['handler'] instanceof Autowire){
51 51
             return $this->config['handler'];
52 52
         }
53 53
 
54
-        if (\class_exists($this->config['handler'])) {
54
+        if (\class_exists($this->config['handler'])){
55 55
             return new Autowire($this->config['handler']);
56 56
         }
57 57
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,15 +43,18 @@
 block discarded – undo
43 43
      */
44 44
     public function getHandler(): ?Autowire
45 45
     {
46
-        if (empty($this->config['handler'])) {
46
+        if (empty($this->config['handler']))
47
+        {
47 48
             return null;
48 49
         }
49 50
 
50
-        if ($this->config['handler'] instanceof Autowire) {
51
+        if ($this->config['handler'] instanceof Autowire)
52
+        {
51 53
             return $this->config['handler'];
52 54
         }
53 55
 
54
-        if (\class_exists($this->config['handler'])) {
56
+        if (\class_exists($this->config['handler']))
57
+        {
55 58
             return new Autowire($this->config['handler']);
56 59
         }
57 60
 
Please login to merge, or discard this patch.