Passed
Pull Request — master (#857)
by Georges
04:15 queued 02:15
created
lib/Phpfastcache/CacheManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -318,7 +318,7 @@
 block discarded – undo
318 318
         $found = false;
319 319
         self::$instances = \array_filter(
320 320
             \array_map(
321
-                static function (ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) {
321
+                static function(ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) {
322 322
                     if (\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)) {
323 323
                         $found = true;
324 324
                         return null;
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Redis/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
         return (new DriverStatistic())
54 54
             ->setData(implode(', ', array_keys($this->itemInstances)))
55 55
             ->setRawData($info)
56
-            ->setSize((int)$info['used_memory'])
56
+            ->setSize((int) $info['used_memory'])
57 57
             ->setInfo(
58 58
                 sprintf(
59 59
                     "The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Mongodb/Driver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $this->database->selectCollection($collectionName)
101 101
                 ->createIndex(
102 102
                     [self::DRIVER_EDATE_WRAPPER_INDEX => 1],
103
-                    ['expireAfterSeconds' => 0,  'name' => 'auto_expire_index']
103
+                    ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index']
104 104
                 );
105 105
         }
106 106
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             )
232 232
         )->toArray()[0];
233 233
 
234
-        $arrayFilterRecursive = static function ($array, callable $callback = null) use (&$arrayFilterRecursive) {
234
+        $arrayFilterRecursive = static function($array, callable $callback = null) use (&$arrayFilterRecursive) {
235 235
             $array = $callback($array);
236 236
 
237 237
             if (\is_object($array) || \is_array($array)) {
@@ -243,12 +243,12 @@  discard block
 block discarded – undo
243 243
             return $array;
244 244
         };
245 245
 
246
-        $callback = static function ($item) {
246
+        $callback = static function($item) {
247 247
             /**
248 248
              * Remove unserializable properties
249 249
              */
250 250
             if ($item instanceof UTCDateTime) {
251
-                return (string)$item;
251
+                return (string) $item;
252 252
             }
253 253
             return $item;
254 254
         };
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Arangodb/Config.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      *  UNIX ENDPOINT: unix:///tmp/arangodb.sock
34 34
      *  Failover ENDPOINTS: ['tcp://127.0.0.1:8529', 'tcp://127.0.0.1:8529']
35 35
      */
36
-    protected string|array $endpoint = 'tcp://127.0.0.1:8529';
36
+    protected string | array $endpoint = 'tcp://127.0.0.1:8529';
37 37
     protected string $connection = 'Keep-Alive';
38 38
 // enum{'Close', 'Keep-Alive'}
39 39
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         return $this;
86 86
     }
87 87
 
88
-    public function getEndpoint(): string|array
88
+    public function getEndpoint(): string | array
89 89
     {
90 90
         return $this->endpoint;
91 91
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     /**
94 94
      * @throws PhpfastcacheLogicException
95 95
      */
96
-    public function setEndpoint(string|array $endpoint): Config
96
+    public function setEndpoint(string | array $endpoint): Config
97 97
     {
98 98
         $this->enforceLockedProperty(__FUNCTION__);
99 99
         $this->endpoint = $endpoint;
Please login to merge, or discard this patch.
lib/Phpfastcache/Config/ConfigurationOption.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     /**
166 166
      * @return callable|string
167 167
      */
168
-    public function getDefaultKeyHashFunction(): callable|string
168
+    public function getDefaultKeyHashFunction(): callable | string
169 169
     {
170 170
         return $this->defaultKeyHashFunction;
171 171
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      * @throws  PhpfastcacheInvalidConfigurationException
177 177
      * @throws PhpfastcacheLogicException
178 178
      */
179
-    public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static
179
+    public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static
180 180
     {
181 181
         $this->enforceLockedProperty(__FUNCTION__);
182 182
         if ($defaultKeyHashFunction && !\is_callable($defaultKeyHashFunction) && (\is_string($defaultKeyHashFunction) && !\function_exists($defaultKeyHashFunction))) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     /**
190 190
      * @return callable|string
191 191
      */
192
-    public function getDefaultFileNameHashFunction(): callable|string
192
+    public function getDefaultFileNameHashFunction(): callable | string
193 193
     {
194 194
         return $this->defaultFileNameHashFunction;
195 195
     }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      * @throws  PhpfastcacheInvalidConfigurationException
201 201
      * @throws PhpfastcacheLogicException
202 202
      */
203
-    public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static
203
+    public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static
204 204
     {
205 205
         $this->enforceLockedProperty(__FUNCTION__);
206 206
         if (!\is_callable($defaultFileNameHashFunction) && (\is_string($defaultFileNameHashFunction) && !\function_exists($defaultFileNameHashFunction))) {
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
      */
342 342
     protected function getDefaultSuperGlobalAccessor(): \Closure
343 343
     {
344
-        return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null): string|int|float|array|bool|null {
344
+        return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null): string | int | float | array | bool | null {
345 345
             return match ($superGlobalName) {
346 346
                 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER,
347 347
                 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST,
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/ExtendedCacheItemPoolInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@
 block discarded – undo
186 186
      * @return bool
187 187
      *   True if the item was successfully persisted. False if there was an error.
188 188
      */
189
-    public function save(ExtendedCacheItemInterface|CacheItemInterface $item): bool;
189
+    public function save(ExtendedCacheItemInterface | CacheItemInterface $item): bool;
190 190
 
191 191
     /**
192 192
      * Save multiple items, possible uses:
Please login to merge, or discard this patch.
lib/Phpfastcache/Core/Pool/TaggableCacheItemPoolTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $driverResponse = $this->getItem($this->getTagKey($tagName));
115 115
         if ($driverResponse->isHit()) {
116
-            $tagsItems = (array)$driverResponse->get();
116
+            $tagsItems = (array) $driverResponse->get();
117 117
 
118 118
             /**
119 119
              * getItems() may provide expired item(s)
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      * @throws PhpfastcacheLogicException
311 311
      * @throws \ReflectionException
312 312
      */
313
-    public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
313
+    public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
314 314
     {
315 315
         $return = true;
316 316
         foreach ($tagNames as $tagName) {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      * @throws PhpfastcacheLogicException
335 335
      * @throws \ReflectionException
336 336
      */
337
-    public function appendItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
337
+    public function appendItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
338 338
     {
339 339
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
340 340
             $item->append($data);
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      * @throws PhpfastcacheLogicException
356 356
      * @throws \ReflectionException
357 357
      */
358
-    public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
358
+    public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
359 359
     {
360 360
         $return = true;
361 361
         foreach ($tagNames as $tagName) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
      * @throws PhpfastcacheLogicException
380 380
      * @throws \ReflectionException
381 381
      */
382
-    public function prependItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
382
+    public function prependItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
383 383
     {
384 384
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
385 385
             $item->prepend($data);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
              * that has slow performances
449 449
              */
450 450
 
451
-            $tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp]))
451
+            $tagsItem->set(\array_merge((array) $data, [$item->getKey() => $expTimestamp]))
452 452
                 ->expiresAt($item->getExpirationDate());
453 453
 
454 454
             $this->driverWrite($tagsItem);
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
         $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags()));
463 463
 
464 464
         foreach ($tagsItems as $tagsItem) {
465
-            $data = (array)$tagsItem->get();
465
+            $data = (array) $tagsItem->get();
466 466
 
467 467
             unset($data[$item->getKey()]);
468 468
             $tagsItem->set($data);
Please login to merge, or discard this patch.
lib/Phpfastcache/Cluster/ClusterPoolAbstract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
219 219
         );
220 220
 
221 221
         $stats->setSize(
222
-            (int)\array_sum(
222
+            (int) \array_sum(
223 223
                 \array_map(
224 224
                     static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getSize(),
225 225
                     $this->clusterPools
Please login to merge, or discard this patch.
lib/Phpfastcache/Helper/Psr16Adapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @return bool
89 89
      * @throws PhpfastcacheSimpleCacheException
90 90
      */
91
-    public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool
91
+    public function set(string $key, mixed $value, null | int | \DateInterval $ttl = null): bool
92 92
     {
93 93
         try {
94 94
             $cacheItem = $this->internalCacheInstance
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @return bool
161 161
      * @throws PhpfastcacheSimpleCacheException
162 162
      */
163
-    public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool
163
+    public function setMultiple(iterable $values, null | int | \DateInterval $ttl = null): bool
164 164
     {
165 165
         try {
166 166
             foreach ($values as $key => $value) {
Please login to merge, or discard this patch.