From c8e20e428a21de022c415f843298eede15b2748c Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sat, 30 Nov 2013 10:14:21 +0100 Subject: [PATCH] Remove interface defining objects aware of command processing. It was too broad in concept and not really that useful, so for now we assume that only our base Predis\Profile\RedisProfile class can handle command processing and we will decide later if we want to add a couple of more methods to Predis\Profile\ProfileInterface. --- .../Processor/CommandProcessingInterface.php | 34 ------------------- lib/Predis/Configuration/ProfileOption.php | 2 +- lib/Predis/Profile/RedisProfile.php | 3 +- 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 lib/Predis/Command/Processor/CommandProcessingInterface.php diff --git a/lib/Predis/Command/Processor/CommandProcessingInterface.php b/lib/Predis/Command/Processor/CommandProcessingInterface.php deleted file mode 100644 index 376d4651..00000000 --- a/lib/Predis/Command/Processor/CommandProcessingInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command\Processor; - -/** - * Defines an object that can process commands using command processors. - * - * @author Daniele Alessandri - */ -interface CommandProcessingInterface -{ - /** - * Associates a command processor. - * - * @param CommandProcessorInterface $processor The command processor. - */ - public function setProcessor(CommandProcessorInterface $processor); - - /** - * Returns the associated command processor. - * - * @return CommandProcessorInterface - */ - public function getProcessor(); -} diff --git a/lib/Predis/Configuration/ProfileOption.php b/lib/Predis/Configuration/ProfileOption.php index 47d19aae..4774b669 100644 --- a/lib/Predis/Configuration/ProfileOption.php +++ b/lib/Predis/Configuration/ProfileOption.php @@ -31,7 +31,7 @@ class ProfileOption implements OptionInterface */ protected function setProcessors(OptionsInterface $options, Profile\ProfileInterface $profile) { - if (isset($options->prefix)) { + if (isset($options->prefix) && $profile instanceof Profile\RedisProfile) { $profile->setProcessor($options->prefix); } } diff --git a/lib/Predis/Profile/RedisProfile.php b/lib/Predis/Profile/RedisProfile.php index 37ab3391..69681110 100644 --- a/lib/Predis/Profile/RedisProfile.php +++ b/lib/Predis/Profile/RedisProfile.php @@ -14,7 +14,6 @@ namespace Predis\Profile; use InvalidArgumentException; use ReflectionClass; use Predis\ClientException; -use Predis\Command\Processor\CommandProcessingInterface; use Predis\Command\Processor\CommandProcessorInterface; /** @@ -22,7 +21,7 @@ use Predis\Command\Processor\CommandProcessorInterface; * * @author Daniele Alessandri */ -abstract class RedisProfile implements ProfileInterface, CommandProcessingInterface +abstract class RedisProfile implements ProfileInterface { private $commands; private $processor;