diff --git a/library/iFixit/Matryoshka/PSR16Adapter.php b/library/iFixit/Matryoshka/PSR16Adapter.php index 85c9260..0783f80 100644 --- a/library/iFixit/Matryoshka/PSR16Adapter.php +++ b/library/iFixit/Matryoshka/PSR16Adapter.php @@ -30,25 +30,26 @@ public function clear(): bool { } public function getMultiple(iterable $keys, mixed $default = null): iterable { - [$found, $missed] = $this->scope->getMultiple(iterator_to_array($keys)); + /** + * @var array $missed + * @var array $found + */ + [$found, $missed] = $this->scope->getMultiple([...$keys]); $missedWithDefault = []; foreach ($missed as $key => $_value) { $missedWithDefault[$key] = $default; } - return [ - ...$found, - ...$missedWithDefault, - ]; + return array_merge($missedWithDefault, $found); } public function setMultiple(iterable $values, null|int|DateInterval $ttl = null): bool { - return $this->scope->setMultiple(iterator_to_array($values), $this->getSeconds($ttl)); + return $this->scope->setMultiple([...$values], $this->getSeconds($ttl)); } public function deleteMultiple(iterable $keys): bool { - return $this->scope->deleteMultiple(iterator_to_array($keys)); + return $this->scope->deleteMultiple([...$keys]); } public function has(string $key): bool {