From f8844ef8b8375ebbaf4e3b2219426f03e3c65b6c Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sat, 5 Mar 2011 10:51:54 +0100 Subject: [PATCH] Rename IServerProfile::registerCommand() to IServerProfile::defineCommand(). --- README.markdown | 2 +- lib/Predis/Profiles/IServerProfile.php | 4 ++-- lib/Predis/Profiles/ServerProfile.php | 6 +++--- test/PredisFeaturesTest.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index add086f5..db72672d 100644 --- a/README.markdown +++ b/README.markdown @@ -103,7 +103,7 @@ client instance at runtime. Actually, it is easier done than said: } $redis = new Predis\Client(); - $redis->getProfile()->registerCommand('BrandNewRedisCommand', 'newcmd'); + $redis->getProfile()->defineCommand('BrandNewRedisCommand', 'newcmd'); $redis->newcmd(); diff --git a/lib/Predis/Profiles/IServerProfile.php b/lib/Predis/Profiles/IServerProfile.php index 8dbe7c1b..0d2505cf 100644 --- a/lib/Predis/Profiles/IServerProfile.php +++ b/lib/Predis/Profiles/IServerProfile.php @@ -6,7 +6,7 @@ interface IServerProfile { public function getVersion(); public function supportsCommand($command); public function supportsCommands(Array $commands); - public function registerCommand($command, $aliases); - public function registerCommands(Array $commands); + public function defineCommand($command, $aliases); + public function defineCommands(Array $commands); public function createCommand($method, $arguments = array()); } diff --git a/lib/Predis/Profiles/ServerProfile.php b/lib/Predis/Profiles/ServerProfile.php index bcb7190a..6a8f3c69 100644 --- a/lib/Predis/Profiles/ServerProfile.php +++ b/lib/Predis/Profiles/ServerProfile.php @@ -88,13 +88,13 @@ abstract class ServerProfile implements IServerProfile { return $command; } - public function registerCommands(Array $commands) { + public function defineCommands(Array $commands) { foreach ($commands as $command => $aliases) { - $this->registerCommand($command, $aliases); + $this->defineCommand($command, $aliases); } } - public function registerCommand($command, $aliases) { + public function defineCommand($command, $aliases) { $commandReflection = new \ReflectionClass($command); if (!$commandReflection->isSubclassOf('\Predis\Commands\ICommand')) { diff --git a/test/PredisFeaturesTest.php b/test/PredisFeaturesTest.php index 724d2a1a..f45bb5e6 100644 --- a/test/PredisFeaturesTest.php +++ b/test/PredisFeaturesTest.php @@ -153,7 +153,7 @@ class PredisClientFeaturesTestSuite extends PHPUnit_Framework_TestCase { $cmdClass = '\Predis\Commands\Multi'; $this->assertFalse($profile->supportsCommand($cmdId)); - $profile->registerCommand(new $cmdClass(), $cmdId); + $profile->defineCommand(new $cmdClass(), $cmdId); $this->assertTrue($profile->supportsCommand($cmdId)); $this->assertType($cmdClass, $profile->createCommand($cmdId)); }