Skip to content

Commit b0b5937

Browse files
committed
Fix undefined variable in cache ArrayTrait
1 parent 0b99a8e commit b0b5937

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function save(CacheItemInterface $item)
124124

125125
return true;
126126
}
127-
if ($this->storeSerialized && null === $value = $this->freeze($value)) {
127+
if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) {
128128
return false;
129129
}
130130
if (null === $expiry && 0 < $item["\0*\0defaultLifetime"]) {

src/Symfony/Component/Cache/Simple/ArrayCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function setMultiple($values, $ttl = null)
129129
$expiry = 0 < $ttl ? microtime(true) + $ttl : PHP_INT_MAX;
130130

131131
foreach ($valuesArray as $key => $value) {
132-
if ($this->storeSerialized && null === $value = $this->freeze($value)) {
132+
if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) {
133133
return false;
134134
}
135135
$this->values[$key] = $value;

src/Symfony/Component/Cache/Traits/ArrayTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function generateItems(array $keys, $now, $f)
113113
}
114114
}
115115

116-
private function freeze($value)
116+
private function freeze($value, $key)
117117
{
118118
if (null === $value) {
119119
return 'N;';

0 commit comments

Comments
 (0)