Fix undefined variable in cache ArrayTrait

This commit is contained in:
Jacek Jędrzejewski 2018-12-13 14:24:29 +01:00
parent 0b99a8e28c
commit b0b5937d1d
3 changed files with 3 additions and 3 deletions

View File

@ -124,7 +124,7 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
return true;
}
if ($this->storeSerialized && null === $value = $this->freeze($value)) {
if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) {
return false;
}
if (null === $expiry && 0 < $item["\0*\0defaultLifetime"]) {

View File

@ -129,7 +129,7 @@ class ArrayCache implements CacheInterface, LoggerAwareInterface, ResettableInte
$expiry = 0 < $ttl ? microtime(true) + $ttl : PHP_INT_MAX;
foreach ($valuesArray as $key => $value) {
if ($this->storeSerialized && null === $value = $this->freeze($value)) {
if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) {
return false;
}
$this->values[$key] = $value;

View File

@ -113,7 +113,7 @@ trait ArrayTrait
}
}
private function freeze($value)
private function freeze($value, $key)
{
if (null === $value) {
return 'N;';