@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function getStats(): DriverStatistic |
| 58 | 58 | { |
| 59 | - $stats = (array)zend_shm_cache_info(); |
|
| 59 | + $stats = (array) zend_shm_cache_info(); |
|
| 60 | 60 | return (new DriverStatistic()) |
| 61 | 61 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 62 | 62 | ->setInfo(sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total'])) |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | protected function driverDelete(string $key, string $encodedKey): bool |
| 109 | 109 | { |
| 110 | - return (bool)zend_shm_cache_delete($key); |
|
| 110 | + return (bool) zend_shm_cache_delete($key); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | protected function driverClear(): bool |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return (new DriverStatistic()) |
| 76 | 76 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 77 | 77 | ->setRawData($info) |
| 78 | - ->setSize((int)$size) |
|
| 78 | + ->setSize((int) $size) |
|
| 79 | 79 | ->setInfo( |
| 80 | 80 | sprintf( |
| 81 | 81 | "The Redis daemon v%s (with Predis v%s) is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * @see https://redis.io/commands/expire |
| 201 | 201 | */ |
| 202 | 202 | if ($ttl <= 0) { |
| 203 | - return (bool)$this->instance->expire($item->getKey(), 0); |
|
| 203 | + return (bool) $this->instance->expire($item->getKey(), 0); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK'; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | protected function driverDelete(string $key, string $encodedKey): bool |
| 215 | 215 | { |
| 216 | - return (bool)$this->instance->del([$key]); |
|
| 216 | + return (bool) $this->instance->del([$key]); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | protected function driverWrite(ExtendedCacheItemInterface $item): bool |
| 113 | 113 | { |
| 114 | 114 | |
| 115 | - return (bool)$this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
| 115 | + return (bool) $this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | protected function driverDelete(string $key, string $encodedKey): bool |
| 124 | 124 | { |
| 125 | - return (bool)$this->instance->del($encodedKey); |
|
| 125 | + return (bool) $this->instance->del($encodedKey); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function getStats(): DriverStatistic |
| 50 | 50 | { |
| 51 | - $stats = (array)apcu_cache_info(); |
|
| 51 | + $stats = (array) apcu_cache_info(); |
|
| 52 | 52 | $date = (new DateTime())->setTimestamp($stats['start_time']); |
| 53 | 53 | |
| 54 | 54 | return (new DriverStatistic()) |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ) |
| 62 | 62 | ) |
| 63 | 63 | ->setRawData($stats) |
| 64 | - ->setSize((int)$stats['mem_size']); |
|
| 64 | + ->setSize((int) $stats['mem_size']); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | protected function driverWrite(ExtendedCacheItemInterface $item): bool |
| 81 | 81 | { |
| 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 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function driverDelete(string $key, string $encodedKey): bool |
| 107 | 107 | { |
| 108 | - return (bool)apcu_delete($key); |
|
| 108 | + return (bool) apcu_delete($key); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | protected function driverDelete(string $key, string $encodedKey): bool |
| 110 | 110 | { |
| 111 | 111 | |
| 112 | - return (bool)zend_disk_cache_delete($key); |
|
| 112 | + return (bool) zend_disk_cache_delete($key); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | protected function driverWrite(ExtendedCacheItemInterface $item): bool |
| 79 | 79 | { |
| 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 | /** |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | */ |
| 69 | 69 | protected function driverReadAllKeys(string $pattern = ''): iterable |
| 70 | 70 | { |
| 71 | - return array_filter(array_keys($this->staticStack), function (string $key) use ($pattern) { |
|
| 71 | + return array_filter(array_keys($this->staticStack), function(string $key) use ($pattern) { |
|
| 72 | 72 | return $pattern |
| 73 | 73 | ? preg_match('/' . str_replace('*', '(.*)', $pattern) . '/', $key) |
| 74 | 74 | : true; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | return (new DriverStatistic()) |
| 57 | 57 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 58 | 58 | ->setRawData($info) |
| 59 | - ->setSize((int)$info['used_memory_dataset']) |
|
| 59 | + ->setSize((int) $info['used_memory_dataset']) |
|
| 60 | 60 | ->setInfo( |
| 61 | 61 | sprintf( |
| 62 | 62 | "The Redis daemon v%s, php-ext v%s, is up since %s.\n For more information see RawData.", |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | /** |
| 118 | 118 | * @throws PhpfastcacheEventManagerException |
| 119 | 119 | */ |
| 120 | - public function on(array|string $events, callable $callback): void |
|
| 120 | + public function on(array | string $events, callable $callback): void |
|
| 121 | 121 | { |
| 122 | 122 | if (is_string($events)) { |
| 123 | 123 | $events = [$events]; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | $this->itemPoolContext = $pool; |
| 186 | 186 | |
| 187 | - $this->onEveryEvents(function (string $eventName, ...$args) { |
|
| 187 | + $this->onEveryEvents(function(string $eventName, ...$args) { |
|
| 188 | 188 | EventManager::getInstance()->dispatch($eventName, ...$args); |
| 189 | 189 | }, 'Scoped' . $pool->getDriverName() . spl_object_hash($this)); |
| 190 | 190 | |