Skip to content

Commit

Permalink
Psalm: Appease
Browse files Browse the repository at this point in the history
  • Loading branch information
jarstelfox committed Jul 16, 2024
1 parent d4c3389 commit 08585b2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions library/iFixit/Matryoshka/PSR16Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, mixed> $missed
* @var array<string, mixed> $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 {
Expand Down

0 comments on commit 08585b2

Please sign in to comment.