소스 검색

Fixed E_NOTICE messages in Predis\RedisServerProfile::createCommand on undefined commands.

Daniele Alessandri 15 년 전
부모
커밋
0bac9308b5
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      lib/Predis.php

+ 2 - 4
lib/Predis.php

@@ -783,12 +783,10 @@ abstract class RedisServerProfile {
     }
     }
 
 
     public function createCommand($method, $arguments = array()) {
     public function createCommand($method, $arguments = array()) {
-        $commandClass = $this->_registeredCommands[$method];
-
-        if ($commandClass === null) {
+        if (!isset($this->_registeredCommands[$method])) {
             throw new ClientException("'$method' is not a registered Redis command");
             throw new ClientException("'$method' is not a registered Redis command");
         }
         }
-
+        $commandClass = $this->_registeredCommands[$method];
         $command = new $commandClass();
         $command = new $commandClass();
         $command->setArgumentsArray($arguments);
         $command->setArgumentsArray($arguments);
         return $command;
         return $command;