@@ -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)), |
@@ -118,7 +118,7 @@ |
||
| 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) { |
@@ -230,7 +230,7 @@ discard block |
||
| 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 |
||
| 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); |