Skip to content

Commit 4c78ad5

Browse files
committed
Allow $cacheItem to be retrieved by callback argument in CacheConditionalHelper
1 parent 08b25ac commit 4c78ad5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Phpfastcache/Helper/CacheConditionalHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function get(string $cacheKey, callable $callback, $expiresAfter = null)
5050
$cacheItem = $this->cacheInstance->getItem($cacheKey);
5151

5252
if (!$cacheItem->isHit()) {
53-
$cacheItem->set($callback());
53+
$cacheItem->set($callback($cacheItem));
5454
if ($expiresAfter) {
5555
$cacheItem->expiresAfter($expiresAfter);
5656
}
@@ -59,4 +59,4 @@ public function get(string $cacheKey, callable $callback, $expiresAfter = null)
5959

6060
return $cacheItem->get();
6161
}
62-
}
62+
}

0 commit comments

Comments
 (0)