From 1c1b4096f608329b8b4dd2b969d69fa474a50dae Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sun, 17 Feb 2013 12:29:02 +0100 Subject: [PATCH] Remove a few more unnecessary strict comparisons. --- lib/Predis/Cluster/PredisClusterHashStrategy.php | 2 +- lib/Predis/Connection/PhpiredisConnection.php | 2 +- lib/Predis/Connection/StreamConnection.php | 2 +- lib/Predis/Profile/ServerProfile.php | 2 +- lib/Predis/Protocol/Text/TextProtocol.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Predis/Cluster/PredisClusterHashStrategy.php b/lib/Predis/Cluster/PredisClusterHashStrategy.php index b2c2df4f..be15ed27 100644 --- a/lib/Predis/Cluster/PredisClusterHashStrategy.php +++ b/lib/Predis/Cluster/PredisClusterHashStrategy.php @@ -341,7 +341,7 @@ class PredisClusterHashStrategy implements CommandHashStrategyInterface */ protected function checkSameHashForKeys(Array $keys) { - if (($count = count($keys)) === 0) { + if (!$count = count($keys)) { return false; } diff --git a/lib/Predis/Connection/PhpiredisConnection.php b/lib/Predis/Connection/PhpiredisConnection.php index 7c3c29b8..42d2957b 100644 --- a/lib/Predis/Connection/PhpiredisConnection.php +++ b/lib/Predis/Connection/PhpiredisConnection.php @@ -296,7 +296,7 @@ class PhpiredisConnection extends AbstractConnection $this->connectWithTimeout($this->parameters); - if (count($this->initCmds) > 0) { + if ($this->initCmds) { $this->sendInitializationCommands(); } } diff --git a/lib/Predis/Connection/StreamConnection.php b/lib/Predis/Connection/StreamConnection.php index 2fdbea92..f3024642 100644 --- a/lib/Predis/Connection/StreamConnection.php +++ b/lib/Predis/Connection/StreamConnection.php @@ -141,7 +141,7 @@ class StreamConnection extends AbstractConnection { parent::connect(); - if (count($this->initCmds) > 0){ + if ($this->initCmds) { $this->sendInitializationCommands(); } } diff --git a/lib/Predis/Profile/ServerProfile.php b/lib/Predis/Profile/ServerProfile.php index 82d14a70..9adb2f49 100644 --- a/lib/Predis/Profile/ServerProfile.php +++ b/lib/Predis/Profile/ServerProfile.php @@ -130,7 +130,7 @@ abstract class ServerProfile implements ServerProfileInterface, CommandProcessin public function supportsCommands(Array $commands) { foreach ($commands as $command) { - if ($this->supportsCommand($command) === false) { + if (!$this->supportsCommand($command)) { return false; } } diff --git a/lib/Predis/Protocol/Text/TextProtocol.php b/lib/Predis/Protocol/Text/TextProtocol.php index a303e6fd..616d62ae 100644 --- a/lib/Predis/Protocol/Text/TextProtocol.php +++ b/lib/Predis/Protocol/Text/TextProtocol.php @@ -98,7 +98,7 @@ class TextProtocol implements ProtocolInterface if ($count === -1) { return null; } - if ($this->mbiterable == true) { + if ($this->mbiterable) { return new MultiBulkResponseSimple($connection, $count); }