Преглед изворни кода

Use instanceof instead of the deprecated is_a().

Daniele Alessandri пре 15 година
родитељ
комит
e229153800
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      lib/Predis.php

+ 2 - 2
lib/Predis.php

@@ -124,7 +124,7 @@ class Client {
 
     public function executeCommandOnShards(Command $command) {
         $replies = array();
-        if (is_a($this->_connection, '\Predis\ConnectionCluster')) {
+        if ($this->_connection instanceof \Predis\ConnectionCluster) {
             foreach($this->_connection as $connection) {
                 $replies[] = self::executeCommandInternal($connection, $command);
             }
@@ -136,7 +136,7 @@ class Client {
     }
 
     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');
         }
         return $this->_connection->rawCommand($rawCommandData, $closesConnection);