@@ -211,7 +211,7 @@ |
||
211 | 211 | /** @var $item ExtendedCacheItemInterface */ |
212 | 212 | $item = new (self::getItemClass())($this, $key, $this->eventManager); |
213 | 213 | |
214 | - $getItemDriverRead = function (float $cacheSlamsSpendSeconds = 0) use (&$getItemDriverRead, $item): void { |
|
214 | + $getItemDriverRead = function(float $cacheSlamsSpendSeconds = 0) use (&$getItemDriverRead, $item): void { |
|
215 | 215 | $config = $this->getConfig(); |
216 | 216 | |
217 | 217 | $driverArray = $this->driverRead($item); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * MUST be thrown. |
228 | 228 | * |
229 | 229 | */ |
230 | - public function appendItemsByTag(string $tagName, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
230 | + public function appendItemsByTag(string $tagName, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
231 | 231 | |
232 | 232 | /** |
233 | 233 | * Append the items from the pool by one of multiple tag names. |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * MUST be thrown. |
247 | 247 | * |
248 | 248 | */ |
249 | - public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
249 | + public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
250 | 250 | |
251 | 251 | /** |
252 | 252 | * Prepend the items from the pool by tag. |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * MUST be thrown. |
266 | 266 | * |
267 | 267 | */ |
268 | - public function prependItemsByTag(string $tagName, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
268 | + public function prependItemsByTag(string $tagName, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
269 | 269 | |
270 | 270 | /** |
271 | 271 | * Prepend the items from the pool by one of multiple tag names. |
@@ -284,5 +284,5 @@ discard block |
||
284 | 284 | * MUST be thrown. |
285 | 285 | * |
286 | 286 | */ |
287 | - public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
287 | + public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
288 | 288 | } |
@@ -76,7 +76,7 @@ discard block |
||
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 |
||
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 |
||
309 | 309 | } |
310 | 310 | } |
311 | 311 | |
312 | - return (bool)($octetWritten ?? false); |
|
312 | + return (bool) ($octetWritten ?? false); |
|
313 | 313 | } |
314 | 314 | } |
@@ -212,7 +212,7 @@ |
||
212 | 212 | * @return bool |
213 | 213 | * True if the item was successfully persisted. False if there was an error. |
214 | 214 | */ |
215 | - public function save(ExtendedCacheItemInterface|CacheItemInterface $item): bool; |
|
215 | + public function save(ExtendedCacheItemInterface | CacheItemInterface $item): bool; |
|
216 | 216 | |
217 | 217 | /** |
218 | 218 | * Save multiple items, possible uses: |
@@ -104,7 +104,7 @@ discard block |
||
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 |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @throws PhpfastcacheLogicException |
281 | 281 | * @throws \ReflectionException |
282 | 282 | */ |
283 | - public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
283 | + public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
284 | 284 | { |
285 | 285 | $return = true; |
286 | 286 | foreach ($tagNames as $tagName) { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * @throws PhpfastcacheLogicException |
302 | 302 | * @throws \ReflectionException |
303 | 303 | */ |
304 | - public function appendItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
304 | + public function appendItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
305 | 305 | { |
306 | 306 | foreach ($this->getItemsByTag($tagName, $strategy) as $item) { |
307 | 307 | $item->append($data); |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @throws PhpfastcacheLogicException |
320 | 320 | * @throws \ReflectionException |
321 | 321 | */ |
322 | - public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
322 | + public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
323 | 323 | { |
324 | 324 | $return = true; |
325 | 325 | foreach ($tagNames as $tagName) { |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * @throws PhpfastcacheLogicException |
341 | 341 | * @throws \ReflectionException |
342 | 342 | */ |
343 | - public function prependItemsByTag(string $tagName, array|string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
343 | + public function prependItemsByTag(string $tagName, array | string $data, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): bool |
|
344 | 344 | { |
345 | 345 | foreach ($this->getItemsByTag($tagName, $strategy) as $item) { |
346 | 346 | $item->prepend($data); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | * avoid to use array_unique |
411 | 411 | * that has slow performances |
412 | 412 | */ |
413 | - $data = \array_merge((array)$data, [$item->getKey() => $expTimestamp]); |
|
413 | + $data = \array_merge((array) $data, [$item->getKey() => $expTimestamp]); |
|
414 | 414 | $tagsItem->set($data); |
415 | 415 | |
416 | 416 | /** |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags())); |
434 | 434 | |
435 | 435 | foreach ($tagsItems as $tagsItem) { |
436 | - $data = (array)$tagsItem->get(); |
|
436 | + $data = (array) $tagsItem->get(); |
|
437 | 437 | |
438 | 438 | unset($data[$item->getKey()]); |
439 | 439 | $tagsItem->set($data); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ]; |
184 | 184 | |
185 | 185 | if ($this->getConfig()->isItemDetailedDate()) { |
186 | - $wrap[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX] = new DateTime();// Always on the latest date |
|
186 | + $wrap[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX] = new DateTime(); // Always on the latest date |
|
187 | 187 | /** |
188 | 188 | * If the creation date exists |
189 | 189 | * reuse it else set a new Date |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | if ($stringifyDate) { |
198 | - \array_walk($wrap, static function (mixed &$value, string $key): void { |
|
198 | + \array_walk($wrap, static function(mixed &$value, string $key): void { |
|
199 | 199 | if ($value instanceof DateTimeInterface && $key !== ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX) { |
200 | 200 | $value = $value->format(DateTimeInterface::W3C); |
201 | 201 | } |
@@ -141,7 +141,7 @@ |
||
141 | 141 | /** |
142 | 142 | * Allows dereferencing char |
143 | 143 | */ |
144 | - $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc. |
|
144 | + $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc. |
|
145 | 145 | $prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : ''; |
146 | 146 | return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes); |
147 | 147 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function getItem(string $key): ExtendedCacheItemInterface |
62 | 62 | { |
63 | 63 | return $this->getStandardizedItem( |
64 | - $this->makeOperation(static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
64 | + $this->makeOperation(static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
65 | 65 | return $pool->getItem($key); |
66 | 66 | }) ?? (new Item($this, $key, $this->getEventManager()))->expiresAfter((int) abs($this->getConfig()->getDefaultTtl())), |
67 | 67 | $this |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | public function save(CacheItemInterface $item): bool |
144 | 144 | { |
145 | 145 | return $this->makeOperation( |
146 | - function (ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
146 | + function(ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
147 | 147 | /** @var ExtendedCacheItemInterface $item */ |
148 | 148 | $item->setHit(true); |
149 | 149 | return $pool->save($this->getStandardizedItem($item, $pool)); |
@@ -227,7 +227,7 @@ |
||
227 | 227 | ); |
228 | 228 | |
229 | 229 | $stats->setSize( |
230 | - (int)\array_sum( |
|
230 | + (int) \array_sum( |
|
231 | 231 | \array_map( |
232 | 232 | static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getSize(), |
233 | 233 | $this->clusterPools |