@@ -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) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @return string |
| 70 | 70 | * @throws PhpfastcacheIOException |
| 71 | 71 | */ |
| 72 | - protected function getFilePath(string|bool $keyword, bool $skip = false): string |
|
| 72 | + protected function getFilePath(string | bool $keyword, bool $skip = false): string |
|
| 73 | 73 | { |
| 74 | 74 | $path = $this->getPath(); |
| 75 | 75 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | throw new PhpfastcacheIOException("Cannot read file located at: $file"); |
| 283 | 283 | } |
| 284 | 284 | if (\function_exists('file_get_contents')) { |
| 285 | - return (string)\file_get_contents($file); |
|
| 285 | + return (string) \file_get_contents($file); |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $string = ''; |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | dirname($file) . \DIRECTORY_SEPARATOR . 'tmp_' . $this->getConfig()->getDefaultFileNameHashFunction()( |
| 328 | 328 | \bin2hex(\random_bytes(16)) |
| 329 | 329 | ) |
| 330 | - ) . '.' . $this->getConfig()->getCacheFileExtension() . \random_int(1000, 9999); |
|
| 330 | + ) . '.' . $this->getConfig()->getCacheFileExtension() . \random_int(1000, 9999); |
|
| 331 | 331 | |
| 332 | 332 | $handle = \fopen($tmpFilename, 'w+b'); |
| 333 | 333 | if (\is_resource($handle)) { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * MUST be thrown. |
| 227 | 227 | * |
| 228 | 228 | */ |
| 229 | - public function appendItemsByTag(string $tagName, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 229 | + public function appendItemsByTag(string $tagName, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 230 | 230 | |
| 231 | 231 | /** |
| 232 | 232 | * Append the items from the pool by one of multiple tag names. |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * MUST be thrown. |
| 246 | 246 | * |
| 247 | 247 | */ |
| 248 | - public function appendItemsByTags(array $tagNames, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 248 | + public function appendItemsByTags(array $tagNames, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 249 | 249 | |
| 250 | 250 | /** |
| 251 | 251 | * Prepend the items from the pool by tag. |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | * MUST be thrown. |
| 265 | 265 | * |
| 266 | 266 | */ |
| 267 | - public function prependItemsByTag(string $tagName, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 267 | + public function prependItemsByTag(string $tagName, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 268 | 268 | |
| 269 | 269 | /** |
| 270 | 270 | * Prepend the items from the pool by one of multiple tag names. |
@@ -283,5 +283,5 @@ discard block |
||
| 283 | 283 | * MUST be thrown. |
| 284 | 284 | * |
| 285 | 285 | */ |
| 286 | - public function prependItemsByTags(array $tagNames, array|string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 286 | + public function prependItemsByTags(array $tagNames, array | string $data, int $strategy = self::TAG_STRATEGY_ONE): bool; |
|
| 287 | 287 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $this->assertCacheItemType($item, Item::class); |
| 112 | 112 | |
| 113 | - return (bool)$this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
| 113 | + return (bool) $this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | $this->assertCacheItemType($item, Item::class); |
| 124 | 124 | |
| 125 | - return (bool)$this->instance->del($item->getEncodedKey()); |
|
| 125 | + return (bool) $this->instance->del($item->getEncodedKey()); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | /** |
| 98 | 98 | * CouchbaseBucket::get() returns a GetResult interface |
| 99 | 99 | */ |
| 100 | - return $this->decodeDocument((array)$this->getCollection()->get($item->getEncodedKey())->content()); |
|
| 100 | + return $this->decodeDocument((array) $this->getCollection()->get($item->getEncodedKey())->content()); |
|
| 101 | 101 | } catch (DocumentNotFoundException) { |
| 102 | 102 | return null; |
| 103 | 103 | } |
@@ -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 | /** |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | |
| 137 | 137 | protected function decodeFirestoreDocument(array $snapshotData): array |
| 138 | 138 | { |
| 139 | - return \array_map(static function ($datum) { |
|
| 139 | + return \array_map(static function($datum) { |
|
| 140 | 140 | if ($datum instanceof GoogleTimestamp) { |
| 141 | 141 | $date = $datum->get(); |
| 142 | 142 | if ($date instanceof \DateTimeImmutable) { |
@@ -171,7 +171,7 @@ discard block |
||
| 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 array|string $data |
@@ -179,7 +179,7 @@ discard block |
||
| 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. |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * @throws PhpfastcacheInvalidTypeException |
| 247 | 247 | */ |
| 248 | - public function append(array|string $data): ExtendedCacheItemInterface |
|
| 248 | + public function append(array | string $data): ExtendedCacheItemInterface |
|
| 249 | 249 | { |
| 250 | 250 | if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) { |
| 251 | 251 | throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot append on a "%s" type.', \gettype($this->data))); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | /** |
| 264 | 264 | * @throws PhpfastcacheInvalidTypeException |
| 265 | 265 | */ |
| 266 | - public function prepend(array|string $data): ExtendedCacheItemInterface |
|
| 266 | + public function prepend(array | string $data): ExtendedCacheItemInterface |
|
| 267 | 267 | { |
| 268 | 268 | if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) { |
| 269 | 269 | throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot prepend on a "%s" type.', \gettype($this->data))); |