@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ) |
| 102 | 102 | )->toArray()[0]; |
| 103 | 103 | |
| 104 | - $arrayFilterRecursive = static function ($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
| 104 | + $arrayFilterRecursive = static function($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
| 105 | 105 | $array = $callback($array); |
| 106 | 106 | |
| 107 | 107 | if (\is_object($array) || \is_array($array)) { |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | return $array; |
| 114 | 114 | }; |
| 115 | 115 | |
| 116 | - $callback = static function ($item) { |
|
| 116 | + $callback = static function($item) { |
|
| 117 | 117 | /** |
| 118 | 118 | * Remove unserializable properties |
| 119 | 119 | */ |
| 120 | 120 | if ($item instanceof UTCDateTime) { |
| 121 | - return (string)$item; |
|
| 121 | + return (string) $item; |
|
| 122 | 122 | } |
| 123 | 123 | return $item; |
| 124 | 124 | }; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | self::DRIVER_CDATE_WRAPPER_INDEX => new UTCDateTime($item->getCreationDate()), |
| 205 | 205 | ]; |
| 206 | 206 | } |
| 207 | - $result = (array)$this->getCollection()->updateOne( |
|
| 207 | + $result = (array) $this->getCollection()->updateOne( |
|
| 208 | 208 | ['_id' => $this->getMongoDbItemKey($item)], |
| 209 | 209 | [ |
| 210 | 210 | '$set' => $set, |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | $this->database->selectCollection($collectionName) |
| 274 | 274 | ->createIndex( |
| 275 | 275 | [self::DRIVER_EDATE_WRAPPER_INDEX => 1], |
| 276 | - ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 276 | + ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 277 | 277 | ); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | if (count($servers) > 0) { |
| 304 | 304 | $host = array_reduce( |
| 305 | 305 | $servers, |
| 306 | - static fn ($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
| 306 | + static fn($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
| 307 | 307 | '' |
| 308 | 308 | ); |
| 309 | 309 | $port = false; |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | { |
| 79 | 79 | $this->assertCacheItemType($item, Item::class); |
| 80 | 80 | |
| 81 | - return (bool)$this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
| 81 | + return (bool) $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function getStats(): DriverStatistic |
| 49 | 49 | { |
| 50 | - $stats = (array)apcu_cache_info(); |
|
| 50 | + $stats = (array) apcu_cache_info(); |
|
| 51 | 51 | $date = (new DateTime())->setTimestamp($stats['start_time']); |
| 52 | 52 | |
| 53 | 53 | return (new DriverStatistic()) |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | ) |
| 61 | 61 | ) |
| 62 | 62 | ->setRawData($stats) |
| 63 | - ->setSize((int)$stats['mem_size']); |
|
| 63 | + ->setSize((int) $stats['mem_size']); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $this->assertCacheItemType($item, Item::class); |
| 82 | 82 | |
| 83 | - return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
| 83 | + return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | $this->assertCacheItemType($item, Item::class); |
| 109 | 109 | |
| 110 | - return (bool)apcu_delete($item->getKey()); |
|
| 110 | + return (bool) apcu_delete($item->getKey()); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | return @apcu_clear_cache(); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - public function getConfig() : Config|ConfigurationOption |
|
| 121 | + public function getConfig() : Config | ConfigurationOption |
|
| 122 | 122 | { |
| 123 | 123 | return $this->config; |
| 124 | 124 | } |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | /** |
| 143 | 143 | * Allows to dereference char |
| 144 | 144 | */ |
| 145 | - $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc. |
|
| 145 | + $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc. |
|
| 146 | 146 | $prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : ''; |
| 147 | 147 | return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes); |
| 148 | 148 | } |
@@ -36,7 +36,7 @@ |
||
| 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)); |
@@ -58,23 +58,23 @@ |
||
| 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 |
@@ -140,7 +140,7 @@ |
||
| 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 | |
@@ -45,11 +45,11 @@ |
||
| 45 | 45 | * @return mixed |
| 46 | 46 | * @throws InvalidArgumentException |
| 47 | 47 | */ |
| 48 | - public function get(string $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed |
|
| 48 | + public function get(string $cacheKey, callable $callback, DateInterval | int $expiresAfter = null): mixed |
|
| 49 | 49 | { |
| 50 | 50 | $cacheItem = $this->cacheInstance->getItem($cacheKey); |
| 51 | 51 | |
| 52 | - if (! $cacheItem->isHit()) { |
|
| 52 | + if (!$cacheItem->isHit()) { |
|
| 53 | 53 | /* |
| 54 | 54 | * |
| 55 | 55 | * Parameter $cacheItem will be available as of 8.0.6 |
@@ -72,7 +72,7 @@ |
||
| 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)), |