Skip to content

Commit 9264a02

Browse files
committed
[12.x] MemoizedStore fix with empty prefix and numeric keys
1 parent cc19412 commit 9264a02

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Illuminate/Cache/MemoizedStore.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,9 @@ public function many(array $keys)
6868

6969
if (count($missing) > 0) {
7070
$retrieved = tap($this->repository->many($missing), function ($values) {
71-
$this->cache = [
72-
...$this->cache,
73-
...collect($values)->mapWithKeys(fn ($value, $key) => [
74-
$this->prefix($key) => $value,
75-
]),
76-
];
71+
foreach ($values as $key => $value) {
72+
$this->cache[$this->prefix($key)] = $value;
73+
}
7774
});
7875
}
7976

0 commit comments

Comments
 (0)