소스 검색

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.
Daniele Alessandri 11 년 전
부모
커밋
c8e20e428a
3개의 변경된 파일2개의 추가작업 그리고 37개의 파일을 삭제
  1. 0 34
      lib/Predis/Command/Processor/CommandProcessingInterface.php
  2. 1 1
      lib/Predis/Configuration/ProfileOption.php
  3. 1 2
      lib/Predis/Profile/RedisProfile.php

+ 0 - 34
lib/Predis/Command/Processor/CommandProcessingInterface.php

@@ -1,34 +0,0 @@
-<?php
-
-/*
- * This file is part of the Predis package.
- *
- * (c) Daniele Alessandri <suppakilla@gmail.com>
- *
- * 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 <suppakilla@gmail.com>
- */
-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();
-}

+ 1 - 1
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);
         }
     }

+ 1 - 2
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 <suppakilla@gmail.com>
  */
-abstract class RedisProfile implements ProfileInterface, CommandProcessingInterface
+abstract class RedisProfile implements ProfileInterface
 {
     private $commands;
     private $processor;