Browse Source

Use instanceof instead of the deprecated is_a().

Daniele Alessandri 15 years ago
parent
commit
e229153800
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lib/Predis.php

+ 2 - 2
lib/Predis.php

@@ -124,7 +124,7 @@ class Client {
 
 
     public function executeCommandOnShards(Command $command) {
     public function executeCommandOnShards(Command $command) {
         $replies = array();
         $replies = array();
-        if (is_a($this->_connection, '\Predis\ConnectionCluster')) {
+        if ($this->_connection instanceof \Predis\ConnectionCluster) {
             foreach($this->_connection as $connection) {
             foreach($this->_connection as $connection) {
                 $replies[] = self::executeCommandInternal($connection, $command);
                 $replies[] = self::executeCommandInternal($connection, $command);
             }
             }
@@ -136,7 +136,7 @@ class Client {
     }
     }
 
 
     public function rawCommand($rawCommandData, $closesConnection = false) {
     public function rawCommand($rawCommandData, $closesConnection = false) {
-        if (is_a($this->_connection, '\Predis\ConnectionCluster')) {
+        if ($this->_connection instanceof \Predis\ConnectionCluster) {
             throw new ClientException('Cannot send raw commands when connected to a cluster of Redis servers');
             throw new ClientException('Cannot send raw commands when connected to a cluster of Redis servers');
         }
         }
         return $this->_connection->rawCommand($rawCommandData, $closesConnection);
         return $this->_connection->rawCommand($rawCommandData, $closesConnection);