Passed
Push — master ( 1e605b...372d62 )
by Georges
01:58
created
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/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/Cluster/Drivers/MasterSlaveReplication/Driver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function getItem(string $key): ExtendedCacheItemInterface
61 61
     {
62 62
         return $this->getStandardizedItem(
63
-            $this->makeOperation(static function (ExtendedCacheItemPoolInterface $pool) use ($key) {
63
+            $this->makeOperation(static function(ExtendedCacheItemPoolInterface $pool) use ($key) {
64 64
                 return $pool->getItem($key);
65 65
             }) ?? (new Item($this, $key, $this->getEventManager()))->expiresAfter((int) abs($this->getConfig()->getDefaultTtl())),
66 66
             $this
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     public function save(CacheItemInterface $item): bool
143 143
     {
144 144
         return $this->makeOperation(
145
-            function (ExtendedCacheItemPoolInterface $pool) use ($item) {
145
+            function(ExtendedCacheItemPoolInterface $pool) use ($item) {
146 146
                 /** @var ExtendedCacheItemInterface $item */
147 147
                 $item->setHit(true);
148 148
                 return $pool->save($this->getStandardizedItem($item, $pool));
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
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      * @return ExtendedCacheItemInterface
172 172
      * @throws PhpfastcacheInvalidTypeException
173 173
      */
174
-    public function append(array|string $data): ExtendedCacheItemInterface;
174
+    public function append(array | string $data): ExtendedCacheItemInterface;
175 175
 
176 176
     /**
177 177
      * @param mixed[]|string $data
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @return ExtendedCacheItemInterface
180 180
      * @throws PhpfastcacheInvalidTypeException
181 181
      */
182
-    public function prepend(array|string $data): ExtendedCacheItemInterface;
182
+    public function prepend(array | string $data): ExtendedCacheItemInterface;
183 183
 
184 184
     /**
185 185
      * Return the data as a well-formatted string.
Please login to merge, or discard this patch.
lib/Phpfastcache/Helper/Psr16Adapter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @throws PhpfastcacheDriverException
50 50
      * @throws PhpfastcacheDriverNotFoundException
51 51
      */
52
-    public function __construct(string|ExtendedCacheItemPoolInterface $driver, ConfigurationOptionInterface $config = null)
52
+    public function __construct(string | ExtendedCacheItemPoolInterface $driver, ConfigurationOptionInterface $config = null)
53 53
     {
54 54
         if ($driver instanceof ExtendedCacheItemPoolInterface) {
55 55
             if ($config !== null) {
@@ -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.
lib/Phpfastcache/Core/Pool/IO/IOHelperTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @throws PhpfastcacheIOException
77 77
      * @throws PhpfastcacheInvalidArgumentException
78 78
      */
79
-    protected function getFilePath(string|bool $keyword, bool $skip = false): string
79
+    protected function getFilePath(string | bool $keyword, bool $skip = false): string
80 80
     {
81 81
         $path = $this->getPath();
82 82
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             throw new PhpfastcacheIOException("Cannot read file located at: $file");
251 251
         }
252 252
         if (\function_exists('file_get_contents')) {
253
-            return (string)\file_get_contents($file);
253
+            return (string) \file_get_contents($file);
254 254
         }
255 255
 
256 256
         $string = '';
@@ -309,6 +309,6 @@  discard block
 block discarded – undo
309 309
             }
310 310
         }
311 311
 
312
-        return (bool)($octetWritten ?? false);
312
+        return (bool) ($octetWritten ?? false);
313 313
     }
314 314
 }
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
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $driverResponse = $this->getItem($this->getTagKey($tagName));
105 105
 
106 106
         if ($driverResponse->isHit()) {
107
-            $tagsItems = (array)$driverResponse->get();
107
+            $tagsItems = (array) $driverResponse->get();
108 108
             /**
109 109
              * getItems() may provide expired item(s)
110 110
              * themselves provided by a cache of item
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      * @throws PhpfastcacheLogicException
280 280
      * @throws \ReflectionException
281 281
      */
282
-    public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
282
+    public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
283 283
     {
284 284
         $return = true;
285 285
         foreach ($tagNames as $tagName) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      * @throws PhpfastcacheLogicException
301 301
      * @throws \ReflectionException
302 302
      */
303
-    public function appendItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
303
+    public function appendItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
304 304
     {
305 305
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
306 306
             $item->append($data);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      * @throws PhpfastcacheLogicException
319 319
      * @throws \ReflectionException
320 320
      */
321
-    public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
321
+    public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
322 322
     {
323 323
         $return = true;
324 324
         foreach ($tagNames as $tagName) {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
      * @throws PhpfastcacheLogicException
340 340
      * @throws \ReflectionException
341 341
      */
342
-    public function prependItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
342
+    public function prependItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool
343 343
     {
344 344
         foreach ($this->getItemsByTag($tagName, $strategy) as $item) {
345 345
             $item->prepend($data);
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
              * avoid to use array_unique
408 408
              * that has slow performances
409 409
              */
410
-            $data = \array_merge((array)$data, [$item->getKey() => $expTimestamp]);
410
+            $data = \array_merge((array) $data, [$item->getKey() => $expTimestamp]);
411 411
             $tagsItem->set($data);
412 412
 
413 413
             /**
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags()));
431 431
 
432 432
         foreach ($tagsItems as $tagsItem) {
433
-            $data = (array)$tagsItem->get();
433
+            $data = (array) $tagsItem->get();
434 434
 
435 435
             unset($data[$item->getKey()]);
436 436
             $tagsItem->set($data);
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Zendshm/Driver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function getStats(): DriverStatistic
58 58
     {
59
-        $stats = (array)zend_shm_cache_info();
59
+        $stats = (array) zend_shm_cache_info();
60 60
         return (new DriverStatistic())
61 61
             ->setData(implode(', ', array_keys($this->itemInstances)))
62 62
             ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total']))
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      */
108 108
     protected function driverDelete(string $key, string $encodedKey): bool
109 109
     {
110
-        return (bool)zend_shm_cache_delete($key);
110
+        return (bool) zend_shm_cache_delete($key);
111 111
     }
112 112
 
113 113
     protected function driverClear(): bool
Please login to merge, or discard this patch.
lib/Phpfastcache/Drivers/Predis/Driver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         return (new DriverStatistic())
76 76
             ->setData(implode(', ', array_keys($this->itemInstances)))
77 77
             ->setRawData($info)
78
-            ->setSize((int)$size)
78
+            ->setSize((int) $size)
79 79
             ->setInfo(
80 80
                 sprintf(
81 81
                     "The Redis daemon v%s (with Predis v%s) is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.",
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
          * @see https://redis.io/commands/expire
201 201
          */
202 202
         if ($ttl <= 0) {
203
-            return (bool)$this->instance->expire($item->getKey(), 0);
203
+            return (bool) $this->instance->expire($item->getKey(), 0);
204 204
         }
205 205
 
206 206
         return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     protected function driverDelete(string $key, string $encodedKey): bool
215 215
     {
216
-        return (bool)$this->instance->del([$key]);
216
+        return (bool) $this->instance->del([$key]);
217 217
     }
218 218
 
219 219
     /**
Please login to merge, or discard this patch.