From 944a478272f52fd10ab5bedd048dcbbe08751610 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sat, 9 Apr 2011 08:33:09 +0200 Subject: [PATCH] Remove Predis\Commands\Command::setArguments(). --- lib/Predis/Commands/Command.php | 7 +------ lib/Predis/Commands/ICommand.php | 2 +- lib/Predis/Profiles/ServerProfile.php | 2 +- test/ClientFeaturesTest.php | 8 +------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/Predis/Commands/Command.php b/lib/Predis/Commands/Command.php index 42eee048..2b7b930d 100644 --- a/lib/Predis/Commands/Command.php +++ b/lib/Predis/Commands/Command.php @@ -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); } diff --git a/lib/Predis/Commands/ICommand.php b/lib/Predis/Commands/ICommand.php index bdd6b835..2d08d319 100644 --- a/lib/Predis/Commands/ICommand.php +++ b/lib/Predis/Commands/ICommand.php @@ -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); } diff --git a/lib/Predis/Profiles/ServerProfile.php b/lib/Predis/Profiles/ServerProfile.php index fe6631db..d87db1d0 100644 --- a/lib/Predis/Profiles/ServerProfile.php +++ b/lib/Predis/Profiles/ServerProfile.php @@ -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; } diff --git a/test/ClientFeaturesTest.php b/test/ClientFeaturesTest.php index 1dd0a7b7..01c98c0b 100644 --- a/test/ClientFeaturesTest.php +++ b/test/ClientFeaturesTest.php @@ -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));