Implement MSETEX and refactor SET.

* Implement the new `MSETEX` Redis command.
* Refactor parsing of extended `SET` arguments into unified helper
  functions, deduplicating logic.
* Add new `SET` arguments `IFNE`, `IFDEQ`, and `IFDNE`. We already
  support Valkey's existing `IFEQ` argument, which Redis has added.

Fixes #2742
This commit is contained in:
michael-grunder
2025-11-05 22:29:28 -08:00
committed by Michael Grunder
parent 730dec06b6
commit 86eabb86eb
7 changed files with 329 additions and 110 deletions
+13
View File
@@ -2902,6 +2902,19 @@ class Redis {
*/
public function mset(array $key_values): Redis|bool;
/**
* Set one or more keys and values with optional expiry information.
*
* @param array $key_vals An array of keys with their values.
* @param int|float|array|null $expiry An optional array with expiry information.
* @return Redis|int|false 1 if all keys were set, 0 if none were.
*
* @see https://redis.io/commands/msetex
*
* @example $redis->msetex(['foo' => 'bar', 'baz' => 'bop'], ['EX' => 60]);
*/
public function msetex(array $key_vals, int|float|array|null $expiry = null): Redis|int|false;
/**
* Set one or more string keys but only if none of the key exist.
*