We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9099e20 commit 3d5b97dCopy full SHA for 3d5b97d
system/Cache/Handlers/RedisHandler.php
@@ -175,19 +175,17 @@ public function delete(string $key)
175
*/
176
public function deleteMatching(string $pattern)
177
{
178
+ /** @var list<string> $matchedKeys */
179
$matchedKeys = [];
180
$pattern = static::validateKey($pattern, $this->prefix);
181
$iterator = null;
182
183
do {
- // Scan for some keys
184
+ /** @var false|list<string>|Redis $keys */
185
$keys = $this->redis->scan($iterator, $pattern);
186
- // Redis may return empty results, so protect against that
187
- if ($keys !== false) {
188
- foreach ($keys as $key) {
189
- $matchedKeys[] = $key;
190
- }
+ if (is_array($keys)) {
+ $matchedKeys = [...$matchedKeys, ...$keys];
191
}
192
} while ($iterator > 0);
193
0 commit comments