From ce00af2c6e974bf09f88cbaef30d7de69bb35111 Mon Sep 17 00:00:00 2001 From: Vasily Zorin Date: Thu, 14 Oct 2021 14:40:25 +0300 Subject: [PATCH] PHP 8 bugfixes --- src/RedisClient/Client/AbstractRedisClient.php | 2 +- src/RedisClient/Command/Traits/AbstractCommandsTrait.php | 2 +- .../Command/Traits/Version2x6/ListsCommandsTrait.php | 4 ++-- src/RedisClient/Pipeline/AbstractPipeline.php | 2 +- src/RedisClient/Pipeline/Version/Pipeline2x6.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/RedisClient/Client/AbstractRedisClient.php b/src/RedisClient/Client/AbstractRedisClient.php index f394123..ae77b4c 100644 --- a/src/RedisClient/Client/AbstractRedisClient.php +++ b/src/RedisClient/Client/AbstractRedisClient.php @@ -270,7 +270,7 @@ protected function executePipeline(PipelineInterface $Pipeline) { /** * @inheritdoc */ - protected function subscribeCommand(array $subCommand, array $unsubCommand, array $params = null, $callback) { + protected function subscribeCommand(array $subCommand, array $unsubCommand, ?array $params, $callback) { $Protocol = $this->getProtocol(); $Protocol->subscribe($this->getStructure($subCommand, $params), $callback); return $this->executeProtocolCommand($Protocol, $unsubCommand, $params); diff --git a/src/RedisClient/Command/Traits/AbstractCommandsTrait.php b/src/RedisClient/Command/Traits/AbstractCommandsTrait.php index 16b48fd..52a4e13 100644 --- a/src/RedisClient/Command/Traits/AbstractCommandsTrait.php +++ b/src/RedisClient/Command/Traits/AbstractCommandsTrait.php @@ -27,7 +27,7 @@ abstract protected function returnCommand(array $command, $keys = null, array $p * @param \Closure|string|array $callback * @return mixed */ - abstract protected function subscribeCommand(array $subCommand, array $unsubCommand, array $params = null, $callback); + abstract protected function subscribeCommand(array $subCommand, array $unsubCommand, ?array $params, $callback); /** * @return string diff --git a/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php b/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php index b019b08..f8f0f57 100644 --- a/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php +++ b/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php @@ -85,13 +85,13 @@ public function lindex($key, $index) { * @link http://redis.io/commands/linsert * * @param string $key - * @param bool|true $after + * @param bool $after * @param string $pivot * @param string $value * @return int The length of the list after the insert operation, * or -1 when the value pivot was not found. Or 0 when key was not found. */ - public function linsert($key, $after = true, $pivot, $value) { + public function linsert($key, $after, $pivot, $value) { return $this->returnCommand(['LINSERT'], $key, [$key, $after ? 'AFTER' : 'BEFORE', $pivot, $value]); } diff --git a/src/RedisClient/Pipeline/AbstractPipeline.php b/src/RedisClient/Pipeline/AbstractPipeline.php index 588f3bb..8fcf3b6 100644 --- a/src/RedisClient/Pipeline/AbstractPipeline.php +++ b/src/RedisClient/Pipeline/AbstractPipeline.php @@ -76,7 +76,7 @@ protected function returnCommand(array $command, $keys = null, array $params = n /** * @inheritdoc */ - protected function subscribeCommand(array $subCommand, array $unsubCommand, array $params = null, $callback) { + protected function subscribeCommand(array $subCommand, array $unsubCommand, ?array $params, $callback) { throw new ErrorException('Do not use subscribe in pipeline'); } diff --git a/src/RedisClient/Pipeline/Version/Pipeline2x6.php b/src/RedisClient/Pipeline/Version/Pipeline2x6.php index cd30a56..4341262 100644 --- a/src/RedisClient/Pipeline/Version/Pipeline2x6.php +++ b/src/RedisClient/Pipeline/Version/Pipeline2x6.php @@ -66,7 +66,7 @@ * @method Pipeline2x6 brpop($keys, $timeout) * @method Pipeline2x6 brpoplpush($source, $destination, $timeout) * @method Pipeline2x6 lindex($key, $index) - * @method Pipeline2x6 linsert($key, $after = true, $pivot, $value) + * @method Pipeline2x6 linsert($key, $after, $pivot, $value) * @method Pipeline2x6 llen($key) * @method Pipeline2x6 lpop($key) * @method Pipeline2x6 lpush($key, $values)