[Cache] minor code update to leverage PHP 7.1
This commit is contained in:
parent
620dfdec13
commit
c1bf1918ec
@ -52,7 +52,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
|
||||
null,
|
||||
CacheItem::class
|
||||
);
|
||||
$getId = function ($key) { return $this->getId((string) $key); };
|
||||
$getId = \Closure::fromCallable(array($this, 'getId'));
|
||||
$this->mergeByLifetime = \Closure::bind(
|
||||
function ($deferred, $namespace, &$expiredIds) use ($getId) {
|
||||
$byLifetime = array();
|
||||
@ -60,6 +60,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
|
||||
$expiredIds = array();
|
||||
|
||||
foreach ($deferred as $key => $item) {
|
||||
$key = (string) $key;
|
||||
if (null === $item->expiry) {
|
||||
$byLifetime[0 < $item->defaultLifetime ? $item->defaultLifetime : 0][$getId($key)] = $item->value;
|
||||
} elseif ($item->expiry > $now) {
|
||||
|
@ -36,7 +36,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
|
||||
private $knownTagVersions = array();
|
||||
private $knownTagVersionsTtl;
|
||||
|
||||
public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, $knownTagVersionsTtl = 0.15)
|
||||
public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, float $knownTagVersionsTtl = 0.15)
|
||||
{
|
||||
$this->pool = $itemsPool;
|
||||
$this->tags = $tagsPool ?: $itemsPool;
|
||||
|
Reference in New Issue
Block a user