@@ -318,7 +318,7 @@ |
||
| 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; |
@@ -53,7 +53,7 @@ |
||
| 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.", |
@@ -100,7 +100,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | }; |
@@ -33,7 +33,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -165,7 +165,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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, |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | protected ConfigurationOptionInterface $config; |
| 46 | 46 | |
| 47 | - protected object|array|null $instance; |
|
| 47 | + protected object | array | null $instance; |
|
| 48 | 48 | |
| 49 | 49 | protected string $driverName; |
| 50 | 50 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | ]; |
| 151 | 151 | |
| 152 | 152 | if ($this->getConfig()->isItemDetailedDate()) { |
| 153 | - $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new DateTime();// Always on the latest date |
|
| 153 | + $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new DateTime(); // Always on the latest date |
|
| 154 | 154 | /** |
| 155 | 155 | * If the creation date exists |
| 156 | 156 | * reuse it else set a new Date |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if ($stringifyDate) { |
| 165 | - \array_walk($wrap, static function (mixed &$value, string $key): void { |
|
| 165 | + \array_walk($wrap, static function(mixed &$value, string $key): void { |
|
| 166 | 166 | if ($value instanceof DateTimeInterface && $key !== self::DRIVER_DATA_WRAPPER_INDEX) { |
| 167 | 167 | $value = $value->format(DateTimeInterface::W3C); |
| 168 | 168 | } |
@@ -186,7 +186,7 @@ |
||
| 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: |
@@ -113,7 +113,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -60,7 +60,7 @@ discard block |
||
| 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(abs($this->getConfig()->getDefaultTtl())), |
| 66 | 66 | $this |
@@ -142,7 +142,7 @@ discard block |
||
| 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)); |