Use instanceof instead of the deprecated is_a().

This commit is contained in:
Daniele Alessandri
2010-02-26 23:04:42 +01:00
parent 7579b2c6b7
commit e229153800
+2 -2
View File
@@ -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);