@@ -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 is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @see https://redis.io/commands/expire |
173 | 173 | */ |
174 | 174 | if ($ttl <= 0) { |
175 | - return (bool)$this->instance->expire($item->getKey(), 0); |
|
175 | + return (bool) $this->instance->expire($item->getKey(), 0); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK'; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * Check for Cross-Driver type confusion |
199 | 199 | */ |
200 | 200 | if ($item instanceof Item) { |
201 | - return (bool)$this->instance->del([$item->getKey()]); |
|
201 | + return (bool) $this->instance->del([$item->getKey()]); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | ->setData(implode(', ', array_keys($this->itemInstances))) |
79 | 79 | ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822))) |
80 | 80 | ->setRawData($stats) |
81 | - ->setSize((int)$stats['bytes']); |
|
81 | + ->setSize((int) $stats['bytes']); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * Check for Cross-Driver type confusion |
118 | 118 | */ |
119 | 119 | if ($item instanceof Item) { |
120 | - return (bool)$this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
120 | + return (bool) $this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * Check for Cross-Driver type confusion |
135 | 135 | */ |
136 | 136 | if ($item instanceof Item) { |
137 | - return (bool)$this->instance->del($item->getEncodedKey()); |
|
137 | + return (bool) $this->instance->del($item->getEncodedKey()); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -151,6 +151,6 @@ discard block |
||
151 | 151 | */ |
152 | 152 | protected function driverClear(): bool |
153 | 153 | { |
154 | - return (bool)$this->instance->flushdb('kv'); |
|
154 | + return (bool) $this->instance->flushdb('kv'); |
|
155 | 155 | } |
156 | 156 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ) |
97 | 97 | )->toArray()[0]; |
98 | 98 | |
99 | - $array_filter_recursive = static function ($array, callable $callback = null) use (&$array_filter_recursive) { |
|
99 | + $array_filter_recursive = static function($array, callable $callback = null) use (&$array_filter_recursive) { |
|
100 | 100 | $array = $callback($array); |
101 | 101 | |
102 | 102 | if (\is_object($array) || \is_array($array)) { |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | return $array; |
109 | 109 | }; |
110 | 110 | |
111 | - $callback = static function ($item) { |
|
111 | + $callback = static function($item) { |
|
112 | 112 | /** |
113 | 113 | * Remove unserializable properties |
114 | 114 | */ |
115 | 115 | if ($item instanceof UTCDateTime) { |
116 | - return (string)$item; |
|
116 | + return (string) $item; |
|
117 | 117 | } |
118 | 118 | return $item; |
119 | 119 | }; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ) : new UTCDateTime(time() * 1000)), |
214 | 214 | ]; |
215 | 215 | } |
216 | - $result = (array)$this->getCollection()->updateOne( |
|
216 | + $result = (array) $this->getCollection()->updateOne( |
|
217 | 217 | ['_id' => $item->getEncodedKey()], |
218 | 218 | [ |
219 | 219 | '$set' => $set, |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | if (count($servers) > 0) { |
309 | 309 | $host = array_reduce( |
310 | 310 | $servers, |
311 | - static function ($carry, $data) { |
|
311 | + static function($carry, $data) { |
|
312 | 312 | $carry .= ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port']; |
313 | 313 | return $carry; |
314 | 314 | }, |
@@ -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 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * Check for Cross-Driver type confusion |
83 | 83 | */ |
84 | 84 | if ($item instanceof Item) { |
85 | - return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
85 | + return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * Check for Cross-Driver type confusion |
115 | 115 | */ |
116 | 116 | if ($item instanceof Item) { |
117 | - return (bool)apcu_delete($item->getKey()); |
|
117 | + return (bool) apcu_delete($item->getKey()); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | if ($item instanceof Item) { |
153 | 153 | try { |
154 | - return (bool)$this->getBucket()->upsert( |
|
154 | + return (bool) $this->getBucket()->upsert( |
|
155 | 155 | $item->getEncodedKey(), |
156 | 156 | $this->encode($this->driverPreWrap($item)), |
157 | 157 | ['expiry' => $item->getTtl()] |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | if ($item instanceof Item) { |
178 | 178 | try { |
179 | - return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
|
179 | + return (bool) $this->getBucket()->remove($item->getEncodedKey()); |
|
180 | 180 | } catch (Exception $e) { |
181 | 181 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
182 | 182 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | return $this->getStandardizedItem( |
61 | 61 | $this->makeOperation( |
62 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
62 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
63 | 63 | return $pool->getItem($key); |
64 | 64 | } |
65 | 65 | ) ?? new Item($this, $key), |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function hasItem($key) |
113 | 113 | { |
114 | 114 | return $this->makeOperation( |
115 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
115 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
116 | 116 | return $pool->hasItem($key); |
117 | 117 | } |
118 | 118 | ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function clear() |
125 | 125 | { |
126 | 126 | return $this->makeOperation( |
127 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
127 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
128 | 128 | return $pool->clear(); |
129 | 129 | } |
130 | 130 | ); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function deleteItem($key) |
137 | 137 | { |
138 | 138 | return $this->makeOperation( |
139 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
139 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
140 | 140 | return $pool->deleteItem($key); |
141 | 141 | } |
142 | 142 | ); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function save(CacheItemInterface $item) |
149 | 149 | { |
150 | 150 | return $this->makeOperation( |
151 | - function (ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
151 | + function(ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
152 | 152 | $item->setHit(true); |
153 | 153 | return $pool->save($this->getStandardizedItem($item, $pool)); |
154 | 154 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function commit() |
163 | 163 | { |
164 | 164 | return $this->makeOperation( |
165 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
165 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
166 | 166 | return $pool->commit(); |
167 | 167 | } |
168 | 168 | ); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | \implode( |
201 | 201 | ', ', |
202 | 202 | \array_map( |
203 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
203 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
204 | 204 | return \get_class($pool); |
205 | 205 | }, |
206 | 206 | $this->clusterPools |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | ); |
211 | 211 | |
212 | 212 | $stats->setSize( |
213 | - (int)\array_sum( |
|
213 | + (int) \array_sum( |
|
214 | 214 | \array_map( |
215 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
215 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
216 | 216 | return $pool->getStats()->getSize(); |
217 | 217 | }, |
218 | 218 | $this->clusterPools |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | ); |
222 | 222 | |
223 | 223 | $stats->setData( |
224 | - (int)\array_map( |
|
225 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
224 | + (int) \array_map( |
|
225 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
226 | 226 | return $pool->getStats()->getData(); |
227 | 227 | }, |
228 | 228 | $this->clusterPools |
@@ -233,7 +233,7 @@ |
||
233 | 233 | */ |
234 | 234 | protected function decode($value) |
235 | 235 | { |
236 | - return \unserialize((string)$value, ['allowed_classes' => true]); |
|
236 | + return \unserialize((string) $value, ['allowed_classes' => true]); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |