@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } elseif ($fallback) { |
147 | 147 | $result[$key] = $this->save( |
148 | 148 | $key, |
149 | - function (CacheItemInterface $item, bool $save) use ($key, $fallback) { |
|
149 | + function(CacheItemInterface $item, bool $save) use ($key, $fallback) { |
|
150 | 150 | return $fallback(...[$key, &$item, &$save]); |
151 | 151 | }, |
152 | 152 | $beta |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | return \array_map( |
160 | - function ($value) { |
|
160 | + function($value) { |
|
161 | 161 | if ($value instanceof CacheItemInterface) { |
162 | 162 | return $value->get(); |
163 | 163 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | static $setExpired; |
195 | 195 | |
196 | 196 | $setExpired = Closure::bind( |
197 | - static function (CacheItem $item) { |
|
197 | + static function(CacheItem $item) { |
|
198 | 198 | if (null === $item->expiry) { |
199 | 199 | return null; |
200 | 200 | } |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | ); |
207 | 207 | |
208 | 208 | if ($this->storage instanceof PhpCachePool) { |
209 | - $setExpired = static function (PhpCacheItem $item) { |
|
209 | + $setExpired = static function(PhpCacheItem $item) { |
|
210 | 210 | return $item->getExpirationTimestamp(); |
211 | 211 | }; |
212 | 212 | } |
213 | 213 | |
214 | - $callback = function (CacheItemInterface $item, bool &$save) use ($key, $callback) { |
|
214 | + $callback = function(CacheItemInterface $item, bool &$save) use ($key, $callback) { |
|
215 | 215 | // don't wrap nor save recursive calls |
216 | 216 | if (isset($this->computing[$key])) { |
217 | 217 | $value = $callback(...[&$item, &$save]); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $key[0][0] = \get_class($callback[0]); |
286 | 286 | } |
287 | 287 | |
288 | - return $this->load($key, function (CacheItemInterface $item, bool $save) use ($callback, $key) { |
|
288 | + return $this->load($key, function(CacheItemInterface $item, bool $save) use ($callback, $key) { |
|
289 | 289 | $dependencies = \array_merge(\array_slice($key, 1), [&$item, &$save]); |
290 | 290 | |
291 | 291 | return $callback(...$dependencies); |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function wrap(callable $callback, ?float $beta = null): callable |
299 | 299 | { |
300 | - return function () use ($callback, $beta) { |
|
300 | + return function() use ($callback, $beta) { |
|
301 | 301 | $key = [$callback, \func_get_args()]; |
302 | 302 | |
303 | 303 | if (\is_array($callback) && \is_object($callback[0])) { |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | if (null === $data = $this->load($key)) { |
308 | 308 | $data = $this->save( |
309 | 309 | $key, |
310 | - function (CacheItemInterface $item, bool $save) use ($callback, $key) { |
|
310 | + function(CacheItemInterface $item, bool $save) use ($callback, $key) { |
|
311 | 311 | $dependencies = \array_merge($key[1], [&$item, &$save]); |
312 | 312 | |
313 | 313 | return $callback(...$dependencies); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | $this->cache->save( |
55 | 55 | $this->key, |
56 | - function (CacheItemInterface $item, bool $save) use ($callback) { |
|
56 | + function(CacheItemInterface $item, bool $save) use ($callback) { |
|
57 | 57 | if (null !== $callback) { |
58 | 58 | $callback(...[&$item, &$save]); |
59 | 59 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->miss = new stdClass(); |
67 | 67 | |
68 | 68 | $this->createCacheItem = Closure::bind( |
69 | - static function ($key, $value, $isHit) { |
|
69 | + static function($key, $value, $isHit) { |
|
70 | 70 | $item = new CacheItem(); |
71 | 71 | $item->key = $key; |
72 | 72 | $item->value = $v = $value; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ); |
94 | 94 | $getId = Closure::fromCallable([$this, 'getId']); |
95 | 95 | $this->mergeByLifetime = Closure::bind( |
96 | - static function ($deferred, &$expiredIds) use ($getId) { |
|
96 | + static function($deferred, &$expiredIds) use ($getId) { |
|
97 | 97 | $byLifetime = []; |
98 | 98 | $now = \microtime(true); |
99 | 99 | $expiredIds = []; |
@@ -147,7 +147,7 @@ |
||
147 | 147 | $pool->clear(); |
148 | 148 | |
149 | 149 | $item = $pool->getItem('foo'); |
150 | - $item->set(function () { |
|
150 | + $item->set(function() { |
|
151 | 151 | return 'value'; |
152 | 152 | }); |
153 | 153 | $pool->saveDeferred($item); |