Skip to content

Commit 8d5489c

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
1 parent 4638bdd commit 8d5489c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CacheTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ private function doGet(CacheItemPoolInterface $pool, string $key, callable $call
4848
}
4949

5050
$item = $pool->getItem($key);
51-
$recompute = !$item->isHit() || INF === $beta;
51+
$recompute = !$item->isHit() || \INF === $beta;
5252
$metadata = $item instanceof ItemInterface ? $item->getMetadata() : [];
5353

5454
if (!$recompute && $metadata) {
5555
$expiry = $metadata[ItemInterface::METADATA_EXPIRY] ?? false;
5656
$ctime = $metadata[ItemInterface::METADATA_CTIME] ?? false;
5757

58-
if ($recompute = $ctime && $expiry && $expiry <= ($now = microtime(true)) - $ctime / 1000 * $beta * log(random_int(1, PHP_INT_MAX) / PHP_INT_MAX)) {
58+
if ($recompute = $ctime && $expiry && $expiry <= ($now = microtime(true)) - $ctime / 1000 * $beta * log(random_int(1, \PHP_INT_MAX) / \PHP_INT_MAX)) {
5959
// force applying defaultLifetime to expiry
6060
$item->expiresAt(null);
6161
$logger && $logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [

0 commit comments

Comments
 (0)