diff --git a/Traits/RedisTrait.php b/Traits/RedisTrait.php index f544b2b..bcd8a8c 100644 --- a/Traits/RedisTrait.php +++ b/Traits/RedisTrait.php @@ -514,7 +514,7 @@ protected function doClear(string $namespace): bool $cursor = null; do { - $keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor, 'MATCH', $pattern, 'COUNT', 1000) : $host->scan($cursor, $pattern, 1000); + $keys = $host instanceof \Predis\ClientInterface ? $host->scan($cursor ?? 0, 'MATCH', $pattern, 'COUNT', 1000) : $host->scan($cursor, $pattern, 1000); if (isset($keys[1]) && \is_array($keys[1])) { $cursor = $keys[0]; $keys = $keys[1];