Passed
Push — v9 ( 3d7679...c0005e )
by Georges
02:06
created
lib/Phpfastcache/Util/ClassNamespaceResolverTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      *
37 37
      * @return array A class map array
38 38
      */
39
-    protected static function createClassMap(Iterator|string|array $dir): array
39
+    protected static function createClassMap(Iterator | string | array $dir): array
40 40
     {
41 41
         if (\is_string($dir)) {
42 42
             $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
Please login to merge, or discard this patch.
lib/Phpfastcache/Config/ConfigurationOptionInterface.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,23 +58,23 @@
 block discarded – undo
58 58
     /**
59 59
      * @return callable|string
60 60
      */
61
-    public function getDefaultKeyHashFunction(): callable|string;
61
+    public function getDefaultKeyHashFunction(): callable | string;
62 62
     /**
63 63
      * @param callable|string $defaultKeyHashFunction
64 64
      * @return ConfigurationOption
65 65
      * @throws  PhpfastcacheInvalidConfigurationException
66 66
      */
67
-    public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static;
67
+    public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static;
68 68
     /**
69 69
      * @return callable|string
70 70
      */
71
-    public function getDefaultFileNameHashFunction(): callable|string;
71
+    public function getDefaultFileNameHashFunction(): callable | string;
72 72
     /**
73 73
      * @param callable|string $defaultFileNameHashFunction
74 74
      * @return ConfigurationOption
75 75
      * @throws  PhpfastcacheInvalidConfigurationException
76 76
      */
77
-    public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static;
77
+    public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static;
78 78
 
79 79
     /**
80 80
      * @return string
Please login to merge, or discard this patch.
lib/Phpfastcache/EventManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
      */
141 141
     public function unbindAllEventCallbacks(): bool
142 142
     {
143
-        $this->events =  [
143
+        $this->events = [
144 144
             self::ON_EVERY_EVENT => []
145 145
         ];
146 146
 
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/TaggableCacheItemTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
      */
73 73
     public function hasTags(array $tagNames, int $strategy = TaggableCacheItemInterface::TAG_STRATEGY_ONE): bool
74 74
     {
75
-        return match ($strategy) {
75
+        return match($strategy) {
76 76
             TaggableCacheItemInterface::TAG_STRATEGY_ONE => !empty(array_intersect($tagNames, $this->tags)),
77 77
             TaggableCacheItemInterface::TAG_STRATEGY_ALL => empty(\array_diff($tagNames, $this->tags)),
78 78
             TaggableCacheItemInterface::TAG_STRATEGY_ONLY => empty(\array_diff($tagNames, $this->tags)) && empty(\array_diff($this->tags, $tagNames)),
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/CacheItemTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
      * @throws PhpfastcacheInvalidArgumentException
119 119
      * @throws \Exception
120 120
      */
121
-    public function expiresAfter(int|\DateInterval|null $time): static
121
+    public function expiresAfter(int | \DateInterval | null $time): static
122 122
     {
123 123
         if (\is_numeric($time)) {
124 124
             if ($time <= 0) {
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/ExtendedCacheItemTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         return $this;
231 231
     }
232 232
 
233
-    public function append(array|string $data): ExtendedCacheItemInterface
233
+    public function append(array | string $data): ExtendedCacheItemInterface
234 234
     {
235 235
         if (\is_array($this->data)) {
236 236
             $this->data[] = $data;
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         return $this;
242 242
     }
243 243
 
244
-    public function prepend(array|string $data): ExtendedCacheItemInterface
244
+    public function prepend(array | string $data): ExtendedCacheItemInterface
245 245
     {
246 246
         if (\is_array($this->data)) {
247 247
             \array_unshift($this->data, $data);
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Item/ExtendedCacheItemInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @return ExtendedCacheItemInterface
158 158
      * @throws PhpfastcacheInvalidArgumentException
159 159
      */
160
-    public function append(array|string $data): ExtendedCacheItemInterface;
160
+    public function append(array | string $data): ExtendedCacheItemInterface;
161 161
 
162 162
     /**
163 163
      * @param array|string $data
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      * @return ExtendedCacheItemInterface
166 166
      * @throws PhpfastcacheInvalidArgumentException
167 167
      */
168
-    public function prepend(array|string $data): ExtendedCacheItemInterface;
168
+    public function prepend(array | string $data): ExtendedCacheItemInterface;
169 169
 
170 170
     /**
171 171
      * Return the data as a well-formatted string.
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $driverResponse = $this->getItem($this->getTagKey($tagName));
114 114
         if ($driverResponse->isHit()) {
115
-            $tagsItems = (array)$driverResponse->get();
115
+            $tagsItems = (array) $driverResponse->get();
116 116
 
117 117
             /**
118 118
              * getItems() may provide expired item(s)
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
              */
127 127
             return \array_filter(
128 128
                 $this->getItems(\array_unique(\array_keys($tagsItems))),
129
-                static fn (ExtendedCacheItemInterface $item) => $item->isHit(),
129
+                static fn(ExtendedCacheItemInterface $item) => $item->isHit(),
130 130
             );
131 131
         }
132 132
         return [];
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      * @throws PhpfastcacheLogicException
310 310
      * @throws \ReflectionException
311 311
      */
312
-    public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
312
+    public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
313 313
     {
314 314
         $return = true;
315 315
         foreach ($tagNames as $tagName) {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
      * @throws PhpfastcacheLogicException
334 334
      * @throws \ReflectionException
335 335
      */
336
-    public function appendItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
336
+    public function appendItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
337 337
     {
338 338
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
339 339
             $item->append($data);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
      * @throws PhpfastcacheLogicException
355 355
      * @throws \ReflectionException
356 356
      */
357
-    public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
357
+    public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
358 358
     {
359 359
         $return = true;
360 360
         foreach ($tagNames as $tagName) {
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      * @throws PhpfastcacheLogicException
379 379
      * @throws \ReflectionException
380 380
      */
381
-    public function prependItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
381
+    public function prependItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
382 382
     {
383 383
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
384 384
             $item->prepend($data);
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
              * that has slow performances
448 448
              */
449 449
 
450
-            $tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp]))
450
+            $tagsItem->set(\array_merge((array) $data, [$item->getKey() => $expTimestamp]))
451 451
                 ->expiresAt($item->getExpirationDate());
452 452
 
453 453
             $this->driverWrite($tagsItem);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags()));
462 462
 
463 463
         foreach ($tagsItems as $tagsItem) {
464
-            $data = (array)$tagsItem->get();
464
+            $data = (array) $tagsItem->get();
465 465
 
466 466
             unset($data[$item->getKey()]);
467 467
             $tagsItem->set($data);
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     protected function getTagKeys(array $keys): array
493 493
     {
494 494
         return \array_map(
495
-            fn (string $key) => $this->getTagKey($key),
495
+            fn(string $key) => $this->getTagKey($key),
496 496
             $keys
497 497
         );
498 498
     }
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      * @return string
70 70
      * @throws PhpfastcacheIOException
71 71
      */
72
-    protected function getFilePath(string|bool $keyword, bool $skip = false): string
72
+    protected function getFilePath(string | bool $keyword, bool $skip = false): string
73 73
     {
74 74
         $path = $this->getPath();
75 75
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
             throw new PhpfastcacheIOException("Cannot read file located at: $file");
283 283
         }
284 284
         if (\function_exists('file_get_contents')) {
285
-            return (string)\file_get_contents($file);
285
+            return (string) \file_get_contents($file);
286 286
         }
287 287
 
288 288
         $string = '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                 dirname($file) . \DIRECTORY_SEPARATOR . 'tmp_' . $this->getConfig()->getDefaultFileNameHashFunction()(
328 328
                     \bin2hex(\random_bytes(16))
329 329
                 )
330
-            ) . '.' .  $this->getConfig()->getCacheFileExtension() . \random_int(1000, 9999);
330
+            ) . '.' . $this->getConfig()->getCacheFileExtension() . \random_int(1000, 9999);
331 331
 
332 332
             $handle = \fopen($tmpFilename, 'w+b');
333 333
             if (\is_resource($handle)) {
Please login to merge, or discard this patch.