Skip to content

Why the null append? #39

Closed
Closed
@spondec

Description

@spondec

Hi,

I don't understand why appending null to the argument list when there is only one item?

A simple FLUSHALL command fails due to the error.

Code:

$redis = new \Redis()
$redis->rawCommand('FLUSHALL'); 

Result:

OK

Code:

$clientFacade = new \MacFJA\RediSearch\Redis\Client\ClientFacade();
$client = $clientFacade->getClient($redis = new \Redis());
$client->executeRaw('FLUSHALL');

Result:

 ErrorException

 Redis::rawcommand(): Raw command arguments must be scalar values!

 at vendor/macfja/redisearch/src/Redis/Client/PhpredisClient.php:81
    77if (count($args) < 2) {
    78$args[] = null;
    79▕         }
    80// @phpstan-ignore-next-line81return $this->redis->rawCommand(...$args);
    82▕     }
    8384protected function doPipeline(Command ...$commands): array
    85▕     {

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions