mirror of
https://github.com/predis/predis.git
synced 2026-08-24 12:19:35 +00:00
5d85628a11
* Add normalizeVariadic to RPUSHX and LPUSHX commands
RPUSHX and LPUSHX commands were missing the setArguments method
with normalizeVariadic call, unlike their RPUSH and LPUSH counterparts.
This caused errors when passing values as a single array argument
(e.g. $client->rpushx('key', ['val1', 'val2'])).
Fixes #1504
* Update CHANGELOG.md with RPUSHX/LPUSHX variadic fix (#1633)
* Fix variadic arguments normalization for [L|R]PUSHX
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
45 lines
841 B
PHP
45 lines
841 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of the Predis package.
|
|
*
|
|
* (c) 2009-2020 Daniele Alessandri
|
|
* (c) 2021-2025 Till Krüss
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Predis\Command\Redis;
|
|
|
|
use Predis\Command\PrefixableCommand as RedisCommand;
|
|
|
|
/**
|
|
* @see http://redis.io/commands/rpushx
|
|
*/
|
|
class RPUSHX extends RedisCommand
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getId()
|
|
{
|
|
return 'RPUSHX';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function setArguments(array $arguments)
|
|
{
|
|
$arguments = self::normalizeVariadic($arguments);
|
|
|
|
parent::setArguments($arguments);
|
|
}
|
|
|
|
public function prefixKeys($prefix)
|
|
{
|
|
$this->applyPrefixForFirstArgument($prefix);
|
|
}
|
|
}
|