mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
fix(commands): Fixed wrong command API call on prefix processing (#1554)
* fix(commands): Fixed wrong command API call on prefix processing * Updated CHANGELOG.md * Updated test case
This commit is contained in:
committed by
GitHub
parent
c2b95dfd2a
commit
5e18e91ffc
@@ -12,6 +12,7 @@
|
||||
- Fixed return type for `ZCOUNT` to be `int` (#1547)
|
||||
- fix(stream): Fixed throwing `CommunicationException` when stream is EOF (#1548)
|
||||
- Removed automatic `conn_uid` parameter assignment (#1552)
|
||||
- fix(commands): Fixed wrong command API call on prefix processing (#1554)
|
||||
|
||||
## v3.0.1 (2025-05-16)
|
||||
### Fixed
|
||||
|
||||
@@ -32,7 +32,7 @@ abstract class PrefixableCommand extends Command implements PrefixableCommandInt
|
||||
*/
|
||||
public function applyPrefixForAllArguments(string $prefix): void
|
||||
{
|
||||
$this->setArguments(
|
||||
$this->setRawArguments(
|
||||
array_map(static function ($key) use ($prefix) {
|
||||
return $prefix . $key;
|
||||
}, $this->getArguments())
|
||||
@@ -49,7 +49,7 @@ abstract class PrefixableCommand extends Command implements PrefixableCommandInt
|
||||
{
|
||||
$arguments = $this->getArguments();
|
||||
$arguments[0] = $prefix . $arguments[0];
|
||||
$this->setArguments($arguments);
|
||||
$this->setRawArguments($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,9 +39,9 @@ class XADD_Test extends PredisCommandTestCase
|
||||
{
|
||||
/** @var PrefixableCommand $command */
|
||||
$command = $this->getCommand();
|
||||
$actualArguments = ['arg1', 'arg2', 'arg3', 'arg4'];
|
||||
$actualArguments = ['key', ['entry' => 'value']];
|
||||
$prefix = 'prefix:';
|
||||
$expectedArguments = ['prefix:arg1', '*'];
|
||||
$expectedArguments = ['prefix:key', '*', 'entry', 'value'];
|
||||
|
||||
$command->setArguments($actualArguments);
|
||||
$command->prefixKeys($prefix);
|
||||
|
||||
Reference in New Issue
Block a user