mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Remove Predis\Commands\Command::setArguments().
This commit is contained in:
@@ -12,12 +12,7 @@ abstract class Command implements ICommand {
|
||||
return $arguments;
|
||||
}
|
||||
|
||||
public function setArguments(/* arguments */) {
|
||||
$this->_arguments = $this->filterArguments(func_get_args());
|
||||
unset($this->_hash);
|
||||
}
|
||||
|
||||
public function setArgumentsArray(Array $arguments) {
|
||||
public function setArguments(Array $arguments) {
|
||||
$this->_arguments = $this->filterArguments($arguments);
|
||||
unset($this->_hash);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use Predis\Distribution\IDistributionStrategy;
|
||||
interface ICommand {
|
||||
public function getId();
|
||||
public function getHash(IDistributionStrategy $distributor);
|
||||
public function setArgumentsArray(Array $arguments);
|
||||
public function setArguments(Array $arguments);
|
||||
public function getArguments();
|
||||
public function parseResponse($data);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ abstract class ServerProfile implements IServerProfile, IPreprocessingSupport {
|
||||
}
|
||||
$commandClass = $this->_registeredCommands[$method];
|
||||
$command = new $commandClass();
|
||||
$command->setArgumentsArray($arguments);
|
||||
$command->setArguments($arguments);
|
||||
return $command;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +65,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
|
||||
$cmdArgs = array('key1', 'key2', 'key3');
|
||||
|
||||
$cmd = new \Predis\Commands\GetMultiple();
|
||||
$cmd->setArgumentsArray($cmdArgs);
|
||||
$this->assertEquals($cmdArgs[0], $cmd->getArgument(0));
|
||||
$this->assertEquals($cmdArgs[1], $cmd->getArgument(1));
|
||||
$this->assertEquals($cmdArgs[2], $cmd->getArgument(2));
|
||||
|
||||
$cmd = new \Predis\Commands\GetMultiple();
|
||||
$cmd->setArguments('key1', 'key2', 'key3');
|
||||
$cmd->setArguments($cmdArgs);
|
||||
$this->assertEquals($cmdArgs[0], $cmd->getArgument(0));
|
||||
$this->assertEquals($cmdArgs[1], $cmd->getArgument(1));
|
||||
$this->assertEquals($cmdArgs[2], $cmd->getArgument(2));
|
||||
|
||||
Reference in New Issue
Block a user