8000 bug #31864 [Cache] Fixed undefined variable in ArrayTrait (eXtreme) · symfony/symfony@e901494 · GitHub
[go: up one dir, main page]

Skip to content

Commit e901494

Browse files
bug #31864 [Cache] Fixed undefined variable in ArrayTrait (eXtreme)
This PR was squashed before being merged into the 4.3 branch (closes #31864). Discussion ---------- [Cache] Fixed undefined variable in ArrayTrait | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | So once again (see #29591) my test suite managed to find an error in ArrayTrait in cache. This time it was this PR: #31395 later improved by #31590 that introduced `$id` to logging, which I guess should be `$key`? So this PR changes it to `$key`, ~but my tests **still fail** as there is no `$this->namespace` in `ArrayAdapter` (is this the only class that uses this ArrayTrait?). But I don't know what to do about it. Maybe @nicolas-grekas has some answers?~ Commits ------- 8568923 [Cache] Fixed undefined variable in ArrayTrait
2 parents fc7ed49 + 8568923 commit e901494

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function freeze($value, $key)
129129
} catch (\Exception $e) {
130130
$type = \is_object($value) ? \get_class($value) : \gettype($value);
131131
$message = sprintf('Failed to save key "{key}" of type %s: %s', $type, $e->getMessage());
132-
CacheItem::log($this->logger, $message, ['key' => substr($id, \strlen($this->namespace)), 'exception' => $e]);
132+
CacheItem::log($this->logger, $message, ['key' => $key, 'exception' => $e]);
133133

134134
return;
135135
}

0 commit comments

Comments
 (0)
0