Closed spondec closed 2 years ago
Hi,
I don't understand why appending null to the argument list when there is only one item?
https://github.com/MacFJA/php-redisearch/blob/61eefb6cd84b17beeafc28d0b08270ea52700a16/src/Redis/Client/PhpredisClient.php#L78
A simple FLUSHALL command fails due to the error.
FLUSHALL
Code:
$redis = new \Redis() $redis->rawCommand('FLUSHALL');
Result:
OK
$clientFacade = new \MacFJA\RediSearch\Redis\Client\ClientFacade(); $client = $clientFacade->getClient($redis = new \Redis()); $client->executeRaw('FLUSHALL');
ErrorException Redis::rawcommand(): Raw command arguments must be scalar values! at vendor/macfja/redisearch/src/Redis/Client/PhpredisClient.php:81 77▕ if (count($args) < 2) { 78▕ $args[] = null; 79▕ } 80▕ // @phpstan-ignore-next-line ➜ 81▕ return $this->redis->rawCommand(...$args); 82▕ } 83▕ 84▕ protected function doPipeline(Command ...$commands): array 85▕ {
My bad, I was mislead by the "PhpDoc" that indicate that the function need at least 2 parameters.
But the documentation (and the code) indicate that only the first parameter is mandatory
I will fix it
I made a correction and publish a new version (v2.1.2)
It should be better now
Hi,
I don't understand why appending null to the argument list when there is only one item?
https://github.com/MacFJA/php-redisearch/blob/61eefb6cd84b17beeafc28d0b08270ea52700a16/src/Redis/Client/PhpredisClient.php#L78
A simple
FLUSHALL
command fails due to the error.Code:
Result:
OK
Code:
Result: