From 542f10c243ba846f1f3b4c07a26136c5fa80d972 Mon Sep 17 00:00:00 2001 From: walkor Date: Thu, 8 Jun 2023 09:39:47 +0800 Subject: [PATCH] Update Client.php --- src/Client.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Client.php b/src/Client.php index c43eb33..483af75 100644 --- a/src/Client.php +++ b/src/Client.php @@ -896,8 +896,10 @@ protected function keyMapCb($command, $key, array $array, $cb) public function __call($method, $args) { $cb = null; - if (\is_callable(end($args))) { - $cb = array_pop($args); + if (count($args) > 1 || in_array($method, ['randomKey', 'multi', 'exec', 'discard'])) { + if (\is_callable(end($args))) { + $cb = array_pop($args); + } } \array_unshift($args, \strtoupper($method));