Passed
Pull Request — master (#735)
by Georges
01:33
created
lib/Phpfastcache/Core/Pool/DriverBaseTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@
 block discarded – undo
233 233
      */
234 234
     protected function decode($value)
235 235
     {
236
-        return \unserialize((string)$value, ['allowed_classes' => true]);
236
+        return \unserialize((string) $value, ['allowed_classes' => true]);
237 237
     }
238 238
 
239 239
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     protected function readFile($file): string
288 288
     {
289 289
         if (\function_exists('file_get_contents')) {
290
-            return (string)\file_get_contents($file);
290
+            return (string) \file_get_contents($file);
291 291
         }
292 292
 
293 293
         $string = '';
@@ -356,6 +356,6 @@  discard block
 block discarded – undo
356 356
             }
357 357
         }
358 358
 
359
-        return (bool)($octetWritten ?? false);
359
+        return (bool) ($octetWritten ?? false);
360 360
     }
361 361
 }
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/CacheItemPoolTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                              * Reset the Item
201 201
                              */
202 202
                             $item->set(null)
203
-                                ->expiresAfter(abs((int)$this->getConfig()['defaultTtl']))
203
+                                ->expiresAfter(abs((int) $this->getConfig()['defaultTtl']))
204 204
                                 ->setHit(false)
205 205
                                 ->setTags([]);
206 206
                             if ($this->getConfig()->isItemDetailedDate()) {
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                             $item->setHit(true);
217 217
                         }
218 218
                     } else {
219
-                        $item->expiresAfter(abs((int)$this->getConfig()['defaultTtl']));
219
+                        $item->expiresAfter(abs((int) $this->getConfig()['defaultTtl']));
220 220
                     }
221 221
                 }
222 222
             }
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             }
281 281
         }
282 282
 
283
-        return (bool)$return;
283
+        return (bool) $return;
284 284
     }
285 285
 
286 286
     /**
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
             }
369 369
         }
370 370
 
371
-        return (bool)$return;
371
+        return (bool) $return;
372 372
     }
373 373
 
374 374
     /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function getItemsByTagsAsJsonString(array $tagNames, int $option = 0, int $depth = 512, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): string
36 36
     {
37
-        $callback = static function (CacheItemInterface $item) {
37
+        $callback = static function(CacheItemInterface $item) {
38 38
             return $item->get();
39 39
         };
40 40
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         if (\is_string($tagName)) {
88 88
             $driverResponse = $this->getItem($this->getTagKey($tagName));
89 89
             if ($driverResponse->isHit()) {
90
-                $tagsItems = (array)$driverResponse->get();
90
+                $tagsItems = (array) $driverResponse->get();
91 91
 
92 92
                 /**
93 93
                  * getItems() may provides expired item(s)
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                  */
102 102
                 return \array_filter(
103 103
                     $this->getItems(\array_unique(\array_keys($tagsItems))),
104
-                    static function (ExtendedCacheItemInterface $item) {
104
+                    static function(ExtendedCacheItemInterface $item) {
105 105
                         return $item->isHit();
106 106
                     }
107 107
                 );
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             }
135 135
         }
136 136
 
137
-        return (bool)$return;
137
+        return (bool) $return;
138 138
     }
139 139
 
140 140
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 }
152 152
             }
153 153
 
154
-            return (bool)$return;
154
+            return (bool) $return;
155 155
         }
156 156
 
157 157
         throw new PhpfastcacheInvalidArgumentException('$tagName must be a string');
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             }
187 187
         }
188 188
 
189
-        return (bool)$return;
189
+        return (bool) $return;
190 190
     }
191 191
 
192 192
     /**
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 $this->saveDeferred($item);
201 201
             }
202 202
 
203
-            return (bool)$this->commit();
203
+            return (bool) $this->commit();
204 204
         }
205 205
 
206 206
         throw new PhpfastcacheInvalidArgumentException('$tagName must be a string and $step an integer');
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             }
220 220
         }
221 221
 
222
-        return (bool)$return;
222
+        return (bool) $return;
223 223
     }
224 224
 
225 225
     /**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                 $this->saveDeferred($item);
234 234
             }
235 235
 
236
-            return (bool)$this->commit();
236
+            return (bool) $this->commit();
237 237
         }
238 238
 
239 239
         throw new PhpfastcacheInvalidArgumentException('$tagName must be a string and $step an integer');
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             }
253 253
         }
254 254
 
255
-        return (bool)$return;
255
+        return (bool) $return;
256 256
     }
257 257
 
258 258
     /**
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                 $this->saveDeferred($item);
267 267
             }
268 268
 
269
-            return (bool)$this->commit();
269
+            return (bool) $this->commit();
270 270
         }
271 271
 
272 272
         throw new PhpfastcacheInvalidArgumentException('$tagName must be a string');
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             }
286 286
         }
287 287
 
288
-        return (bool)$return;
288
+        return (bool) $return;
289 289
     }
290 290
 
291 291
     /**
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                 $this->saveDeferred($item);
300 300
             }
301 301
 
302
-            return (bool)$this->commit();
302
+            return (bool) $this->commit();
303 303
         }
304 304
 
305 305
         throw new PhpfastcacheInvalidArgumentException('$tagName must be a string');
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
              * that has slow performances
361 361
              */
362 362
 
363
-            $tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp]));
363
+            $tagsItem->set(\array_merge((array) $data, [$item->getKey() => $expTimestamp]));
364 364
 
365 365
             /**
366 366
              * Set the expiration date
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags()));
383 383
 
384 384
         foreach ($tagsItems as $tagsItem) {
385
-            $data = (array)$tagsItem->get();
385
+            $data = (array) $tagsItem->get();
386 386
 
387 387
             unset($data[$item->getKey()]);
388 388
             $tagsItem->set($data);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     protected function getTagKeys(array $keys): array
414 414
     {
415 415
         return \array_map(
416
-            function (string $key) {
416
+            function(string $key) {
417 417
                 return $this->getTagKey($key);
418 418
             },
419 419
             $keys
Please login to merge, or discard this patch.
lib/Phpfastcache/Autoload/Autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
  * Register Autoload
28 28
  */
29 29
 spl_autoload_register(
30
-    static function ($entity): void {
30
+    static function($entity): void {
31 31
         $module = explode('\\', $entity, 2);
32 32
         if (!\in_array($module[0], ['Phpfastcache', 'Psr'])) {
33 33
             /**
Please login to merge, or discard this patch.
lib/Phpfastcache/Util/Directory.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
             return unlink($source);
92 92
         }
93 93
 
94
-        $files = new RecursiveIteratorIterator
95
-        (
94
+        $files = new RecursiveIteratorIterator(
96 95
             new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
97 96
             RecursiveIteratorIterator::CHILD_FIRST
98 97
         );
@@ -144,7 +143,7 @@  discard block
 block discarded – undo
144 143
         /**
145 144
          * Allows to dereference char
146 145
          */
147
-        $__FILE__ = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
146
+        $__FILE__ = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc.
148 147
         $prefix = $__FILE__[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
149 148
         return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes);
150 149
     }
Please login to merge, or discard this patch.