8000 [Cache] Fix return type of `Redis6Proxy::mget()` by alexandre-daubois · Pull Request #52700 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] Fix return type of Redis6Proxy::mget() #52700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Symfony/Component/Cache/Traits/Redis6Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,14 @@ public function ltrim($key, $start, $end): \Redis|bool

public function mget($keys): \Redis|array
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args());
/**
* Handle the special case where `mget()` returns false, waiting for the stub to be fixed.
*
* @see https://github.com/phpredis/phpredis/issues/1810
*/
$v = ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args());

return $v === false ? [] : $v;
}

public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $replace = false, #[\SensitiveParameter] $credentials = null): \Redis|bool
Expand Down
0