From 53d6b4f018da620754de33e744432bfad3a01c85 Mon Sep 17 00:00:00 2001 From: Ethan Hann Date: Sat, 4 Jun 2022 15:48:53 -0700 Subject: [PATCH] Resolves #81 - Add optional param values to linsert This is more just a quick fix to resolve issue #81. Really, $after should be at the end of the argument list (as $pivot and $value should always have arguments) or $after shouldn't have a default value, but both of those changes would break backward compatibility. --- .../Command/Traits/Version2x6/ListsCommandsTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php b/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php index b019b08..bc11969 100644 --- a/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php +++ b/src/RedisClient/Command/Traits/Version2x6/ListsCommandsTrait.php @@ -91,7 +91,7 @@ public function lindex($key, $index) { * @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 = true, $pivot = '', $value = '') { return $this->returnCommand(['LINSERT'], $key, [$key, $after ? 'AFTER' : 'BEFORE', $pivot, $value]); }