Skip to content

Commit c1bf191

Browse files
[Cache] minor code update to leverage PHP 7.1
1 parent 620dfde commit c1bf191

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ function ($key, $value, $isHit) use ($defaultLifetime) {
5252
null,
5353
CacheItem::class
5454
);
55-
$getId = function ($key) { return $this->getId((string) $key); };
55+
$getId = \Closure::fromCallable(array($this, 'getId'));
5656
$this->mergeByLifetime = \Closure::bind(
5757
function ($deferred, $namespace, &$expiredIds) use ($getId) {
5858
$byLifetime = array();
5959
$now = time();
6060
$expiredIds = array();
6161

6262
foreach ($deferred as $key => $item) {
63+
$key = (string) $key;
6364
if (null === $item->expiry) {
6465
$byLifetime[0 < $item->defaultLifetime ? $item->defaultLifetime : 0][$getId($key)] = $item->value;
6566
} elseif ($item->expiry > $now) {

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
3636
private $knownTagVersions = array();
3737
private $knownTagVersionsTtl;
3838

39-
public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, $knownTagVersionsTtl = 0.15)
39+
public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsPool = null, float $knownTagVersionsTtl = 0.15)
4040
{
4141
$this->pool = $itemsPool;
4242
$this->tags = $tagsPool ?: $itemsPool;

0 commit comments

Comments
 (0)