Test Failed
Push — master ( 0f2ecd...7d85b5 )
by
unknown
16:30 queued 14s
created
phpfastcache/lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,8 @@
 block discarded – undo
102 102
     {
103 103
         if ($tags === [] || \array_filter($tags, 'is_string')) {
104 104
             $this->tags = $tags;
105
-        } else {
105
+        }
106
+        else {
106 107
             throw new PhpfastcacheInvalidArgumentException('$tagName must be an array of string');
107 108
         }
108 109
 
Please login to merge, or discard this patch.
phpfastcache/lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@  discard block
 block discarded – undo
39 39
      * @param EventManagerInterface $em
40 40
      * @throws PhpfastcacheInvalidArgumentException
41 41
      */
42
-    public function __construct(ExtendedCacheItemPoolInterface $driver, string $key, EventManagerInterface $em)
43
-    {
42
+    public function __construct(ExtendedCacheItemPoolInterface $driver, string $key, EventManagerInterface $em) {
44 43
         $this->data = null;
45 44
         $this->key = $key;
46 45
         $this->setEventManager($em);
@@ -248,7 +247,8 @@  discard block
 block discarded – undo
248 247
 
249 248
         if (\is_array($this->data)) {
250 249
             $this->data[] = $data;
251
-        } else {
250
+        }
251
+        else {
252 252
             $this->data .= $data;
253 253
         }
254 254
 
@@ -266,7 +266,8 @@  discard block
 block discarded – undo
266 266
 
267 267
         if (\is_array($this->data)) {
268 268
             \array_unshift($this->data, $data);
269
-        } else {
269
+        }
270
+        else {
270 271
             $this->data = $data . $this->data;
271 272
         }
272 273
 
@@ -286,7 +287,8 @@  discard block
 block discarded – undo
286 287
 
287 288
         if (\is_object($data) || \is_array($data)) {
288 289
             $data = \json_encode($data, $options, $depth);
289
-        } else {
290
+        }
291
+        else {
290 292
             $data = \json_encode([$data], $options, $depth);
291 293
         }
292 294
 
Please login to merge, or discard this patch.
phpfastcache/phpfastcache/lib/Phpfastcache/Core/Item/CacheItemTrait.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,7 +103,8 @@  discard block
 block discarded – undo
103 103
         if ($expiration instanceof DateTimeInterface) {
104 104
             $this->eventManager->dispatch(Event::CACHE_ITEM_EXPIRE_AT, $this, $expiration);
105 105
             $this->expirationDate = $this->demutateDatetime($expiration);
106
-        } else {
106
+        }
107
+        else {
107 108
             throw new PhpfastcacheInvalidArgumentException('$expiration must be an object implementing the DateTimeInterface got: ' . \gettype($expiration));
108 109
         }
109 110
 
@@ -129,11 +130,13 @@  discard block
 block discarded – undo
129 130
             $this->eventManager->dispatch(Event::CACHE_ITEM_EXPIRE_AFTER, $this, $time);
130 131
 
131 132
             $this->expirationDate = (new DateTime())->add(new DateInterval(\sprintf('PT%dS', $time)));
132
-        } elseif ($time instanceof DateInterval) {
133
+        }
134
+        elseif ($time instanceof DateInterval) {
133 135
             $this->eventManager->dispatch(Event::CACHE_ITEM_EXPIRE_AFTER, $this, $time);
134 136
 
135 137
             $this->expirationDate = (new DateTime())->add($time);
136
-        } else {
138
+        }
139
+        else {
137 140
             throw new PhpfastcacheInvalidArgumentException(\sprintf('Invalid date format, got "%s"', \gettype($time)));
138 141
         }
139 142
 
Please login to merge, or discard this patch.
phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php 1 patch
Braces   +23 added lines, -13 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     protected DriverIO $IO;
64 64
 
65
-    public function __construct(#[\SensitiveParameter] ConfigurationOptionInterface $config, string $instanceId, EventManagerInterface $em)
66
-    {
65
+    public function __construct(#[\SensitiveParameter] ConfigurationOptionInterface $config, string $instanceId, EventManagerInterface $em) {
67 66
         $this->IO = new DriverIO();
68 67
         $this->__driverBaseConstruct($config, $instanceId, $em);
69 68
     }
@@ -135,7 +134,8 @@  discard block
 block discarded – undo
135 134
 
136 135
                 try {
137 136
                     $driverArrays = $this->driverReadMultiple(...$items);
138
-                } catch (PhpfastcacheUnsupportedMethodException) {
137
+                }
138
+                catch (PhpfastcacheUnsupportedMethodException) {
139 139
                     /**
140 140
                      * Fallback for drivers that does not yet implement driverReadMultiple() method.
141 141
                      */
@@ -143,7 +143,8 @@  discard block
 block discarded – undo
143 143
                         array_map(fn($item) => $item->getKey(), $items),
144 144
                         array_map(fn($item) => $this->driverRead($item), $items)
145 145
                     );
146
-                } finally {
146
+                }
147
+                finally {
147 148
                     foreach ($items as $item) {
148 149
                         $driverArray = $driverArrays[$item->getKey()] ?? null;
149 150
                         if ($driverArray !== null) {
@@ -160,19 +161,22 @@  discard block
 block discarded – undo
160 161
                             }
161 162
                             $item->setTags($this->driverUnwrapTags($driverArray));
162 163
                             $this->handleExpiredCacheItem($item);
163
-                        } else {
164
+                        }
165
+                        else {
164 166
                             $item->expiresAfter((int) abs($this->getConfig()->getDefaultTtl()));
165 167
                         }
166 168
                         $item->isHit() ? $this->getIO()->incReadHit() : $this->getIO()->incReadMiss();
167 169
                     }
168 170
                 }
169
-            } else {
171
+            }
172
+            else {
170 173
                 $index = array_key_first($keys);
171 174
                 if ($index !== null) {
172 175
                     $items[$keys[$index]] = $this->getItem($keys[$index]);
173 176
                 }
174 177
             }
175
-        } else {
178
+        }
179
+        else {
176 180
             $collection = [];
177 181
 
178 182
             foreach ($keys as $key) {
@@ -261,12 +265,14 @@  discard block
 block discarded – undo
261 265
 
262 266
                     $item->setTags($this->driverUnwrapTags($driverArray));
263 267
                     $this->handleExpiredCacheItem($item);
264
-                } else {
268
+                }
269
+                else {
265 270
                     $item->expiresAfter((int) abs($this->getConfig()->getDefaultTtl()));
266 271
                 }
267 272
             };
268 273
             $getItemDriverRead();
269
-        } else {
274
+        }
275
+        else {
270 276
             $item = $this->itemInstances[$key];
271 277
         }
272 278
 
@@ -332,7 +338,8 @@  discard block
 block discarded – undo
332 338
                 $this->getIO()->incWriteHit();
333 339
                 $this->eventManager->dispatch(Event::CACHE_DELETE_ITEMS, $this, $items);
334 340
                 $this->deregisterItems($keys);
335
-            } catch (PhpfastcacheUnsupportedMethodException) {
341
+            }
342
+            catch (PhpfastcacheUnsupportedMethodException) {
336 343
                 foreach ($keys as $key) {
337 344
                     $result = $this->deleteItem($key);
338 345
                     if ($result !== true) {
@@ -398,7 +405,8 @@  discard block
 block discarded – undo
398 405
         $this->assertCacheItemType($item, self::getItemClass());
399 406
         if (!\array_key_exists($item->getKey(), $this->itemInstances)) {
400 407
             $this->itemInstances[$item->getKey()] = $item;
401
-        } elseif (\spl_object_hash($item) !== \spl_object_hash($this->itemInstances[$item->getKey()])) {
408
+        }
409
+        elseif (\spl_object_hash($item) !== \spl_object_hash($this->itemInstances[$item->getKey()])) {
402 410
             throw new RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
403 411
         }
404 412
 
@@ -457,7 +465,8 @@  discard block
 block discarded – undo
457 465
             if ($this->getConfig()->isUseStaticItemCaching()) {
458 466
                 $this->itemInstances[$item->getKey()] = $item;
459 467
             }
460
-        } elseif (\spl_object_hash($item) !== \spl_object_hash($this->itemInstances[$item->getKey()])) {
468
+        }
469
+        elseif (\spl_object_hash($item) !== \spl_object_hash($this->itemInstances[$item->getKey()])) {
461 470
             throw new RuntimeException('Spl object hash mismatches ! You probably tried to save a detached item which has been already retrieved from cache.');
462 471
         }
463 472
 
@@ -609,7 +618,8 @@  discard block
 block discarded – undo
609 618
                 $item->setCreationDate(new DateTime());
610 619
                 $item->setModificationDate(new DateTime());
611 620
             }
612
-        } else {
621
+        }
622
+        else {
613 623
             $item->setHit(true);
614 624
         }
615 625
     }
Please login to merge, or discard this patch.
phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
         if ($this->getConfig()->isUseStaticItemCaching()) {
64 64
             $stat->setData(implode(', ', \array_keys($this->itemInstances)));
65
-        } else {
65
+        }
66
+        else {
66 67
             $stat->setData('No data available since static item caching option (useStaticItemCaching) is disabled.');
67 68
         }
68 69
 
@@ -120,7 +121,8 @@  discard block
 block discarded – undo
120 121
 
121 122
         if (empty($this->getConfig()->getPath())) {
122 123
             $path = $tmpDir;
123
-        } else {
124
+        }
125
+        else {
124 126
             $path = \rtrim($this->getConfig()->getPath(), '/') . DIRECTORY_SEPARATOR;
125 127
         }
126 128
 
@@ -152,7 +154,8 @@  discard block
 block discarded – undo
152 154
         if (!$securityKey || \mb_strtolower($securityKey) === 'auto') {
153 155
             if (isset($httpHost)) {
154 156
                 $securityKey = \preg_replace('/^www./', '', \strtolower(\str_replace(':', '_', $httpHost)));
155
-            } else {
157
+            }
158
+            else {
156 159
                 $securityKey = (SapiDetector::isWebScript() ? 'web' : 'cli');
157 160
             }
158 161
         }
@@ -176,7 +179,8 @@  discard block
 block discarded – undo
176 179
                 if (@mkdir($fullPath, $this->getDefaultChmod(), true) === false && !\is_dir($fullPath)) {
177 180
                     throw new PhpfastcacheIOException('The directory ' . $fullPath . ' could not be created.');
178 181
                 }
179
-            } elseif (!@\is_writable($fullPath) && !@\chmod($fullPath, $this->getDefaultChmod()) && $this->getConfig()->isAutoTmpFallback()) {
182
+            }
183
+            elseif (!@\is_writable($fullPath) && !@\chmod($fullPath, $this->getDefaultChmod()) && $this->getConfig()->isAutoTmpFallback()) {
180 184
                 /**
181 185
                  * Switch back to tmp dir
182 186
                  * again if the path is not writable
@@ -301,7 +305,8 @@  discard block
 block discarded – undo
301 305
             if (!\rename($tmpFilename, $file)) {
302 306
                 throw new PhpfastcacheIOException(\sprintf('Failed to rename %s to %s', $tmpFilename, $file));
303 307
             }
304
-        } else {
308
+        }
309
+        else {
305 310
             $handle = \fopen($file, 'w+b');
306 311
             if (\is_resource($handle)) {
307 312
                 $octetWritten = \fwrite($handle, $data);
Please login to merge, or discard this patch.
phpfastcache/lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -449,7 +449,8 @@
 block discarded – undo
449 449
                 $tagsItem->expiresAt((new DateTime())->setTimestamp(max($data)));
450 450
                 $this->driverWrite($tagsItem);
451 451
                 $tagsItem->setHit(true);
452
-            } else {
452
+            }
453
+            else {
453 454
                 $this->deleteItem($tagsItem->getKey());
454 455
             }
455 456
         }
Please login to merge, or discard this patch.
phpfastcache/phpfastcache/lib/Phpfastcache/Core/Pool/DriverBaseTrait.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@  discard block
 block discarded – undo
70 70
      * @throws PhpfastcacheIOException
71 71
      * @throws PhpfastcacheInvalidArgumentException
72 72
      */
73
-    public function __construct(#[\SensitiveParameter] ConfigurationOptionInterface $config, string $instanceId, EventManagerInterface $em)
74
-    {
73
+    public function __construct(#[\SensitiveParameter] ConfigurationOptionInterface $config, string $instanceId, EventManagerInterface $em) {
75 74
         $this->setEventManager($em->getScopedEventManager($this));
76 75
         $this->setConfig($config);
77 76
         $this->instanceId = $instanceId;
@@ -91,7 +90,8 @@  discard block
 block discarded – undo
91 90
             $this->driverConnect();
92 91
             $config->lock($this); // Lock the config only after a successful driver connection.
93 92
             $this->eventManager->dispatch(Event::CACHE_DRIVER_CONNECTED, $this, $this->instance ?? null);
94
-        } catch (Throwable $e) {
93
+        }
94
+        catch (Throwable $e) {
95 95
             throw new PhpfastcacheDriverConnectException(
96 96
                 sprintf(
97 97
                     ExtendedCacheItemPoolInterface::DRIVER_CONNECT_FAILURE,
@@ -189,7 +189,8 @@  discard block
 block discarded – undo
189 189
              * reuse it else set a new Date
190 190
              */
191 191
             $wrap[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = $item->getCreationDate();
192
-        } else {
192
+        }
193
+        else {
193 194
             $wrap[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX] = null;
194 195
             $wrap[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = null;
195 196
         }
Please login to merge, or discard this patch.
php/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/ExtensionManager.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,8 @@
 block discarded – undo
68 68
     {
69 69
         if (isset(self::$registeredExtensions[$name])) {
70 70
             return self::$registeredExtensions[$name];
71
-        } else {
71
+        }
72
+        else {
72 73
             throw new PhpfastcacheExtensionNotFoundException(
73 74
                 sprintf(
74 75
                     'Unable too find the %s extension. Make sure that you you added through composer: `composer require phpfastcache/%s-extension`',
Please login to merge, or discard this patch.
phpfastcache/lib/Phpfastcache/Util/ClassNamespaceResolverTrait.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,8 @@  discard block
 block discarded – undo
135 135
             $t = $tokens[$index];
136 136
             if (T_STRING === $t[0]) {
137 137
                 $class .= $t[1];
138
-            } elseif ('' !== $class && T_WHITESPACE === $t[0]) {
138
+            }
139
+            elseif ('' !== $class && T_WHITESPACE === $t[0]) {
139 140
                 break;
140 141
             }
141 142
         }
@@ -160,7 +161,8 @@  discard block
 block discarded – undo
160 161
                     break;
161 162
                 }
162 163
             }
163
-        } else {
164
+        }
165
+        else {
164 166
             while (isset($tokens[++$index][1])) {
165 167
                 if (\in_array($tokens[$index][0], [T_STRING, T_NS_SEPARATOR], true)) {
166 168
                     $namespace .= $tokens[$index][1];
Please login to merge, or discard this patch.