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:
Vladyslav Vildanov
2025-06-11 10:46:25 +03:00
committed by GitHub
parent c2b95dfd2a
commit 5e18e91ffc
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -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
+2 -2
View File
@@ -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);
}
/**
+2 -2
View File
@@ -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);