Remove a few unnecessary strict comparisons.

This commit is contained in:
Daniele Alessandri
2013-02-16 14:56:22 +01:00
parent 2781bd780f
commit 8cbcb09c4c
4 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -62,7 +62,7 @@ class Client implements ClientInterface
*/
protected function filterOptions($options)
{
if ($options === null) {
if (!isset($options)) {
return new ClientOptions();
}
@@ -149,7 +149,7 @@ class Client implements ClientInterface
*/
public function getClientFor($connectionID)
{
if (($connection = $this->getConnectionById($connectionID)) === null) {
if (!$connection = $this->getConnectionById($connectionID)) {
throw new \InvalidArgumentException("Invalid connection ID: '$connectionID'");
}
@@ -280,14 +280,14 @@ class Client implements ClientInterface
$response = $this->executeCommand($eval);
if (false === $response instanceof ResponseObjectInterface) {
if (!$response instanceof ResponseObjectInterface) {
$response = $command->parseResponse($response);
}
return $response;
}
if ($this->options->exceptions === true) {
if ($this->options->exceptions) {
throw new ServerException($response->getMessage());
}
+1 -1
View File
@@ -122,7 +122,7 @@ class HashRing implements DistributionStrategyInterface, HashGeneratorInterface
return;
}
if (count($this->nodes) === 0) {
if (!$this->nodes) {
throw new EmptyRingException('Cannot initialize empty hashring');
}
+1 -1
View File
@@ -67,7 +67,7 @@ abstract class AbstractCommand implements CommandInterface
*/
public function getArgument($index = 0)
{
if (isset($this->arguments[$index]) === true) {
if (isset($this->arguments[$index])) {
return $this->arguments[$index];
}
}
+3 -3
View File
@@ -81,10 +81,10 @@ class StreamConnection extends AbstractConnection
$uri = "tcp://{$parameters->host}:{$parameters->port}/";
$flags = STREAM_CLIENT_CONNECT;
if (isset($parameters->async_connect) && $parameters->async_connect === true) {
if (isset($parameters->async_connect) && $parameters->async_connect) {
$flags |= STREAM_CLIENT_ASYNC_CONNECT;
}
if (isset($parameters->persistent) && $parameters->persistent === true) {
if (isset($parameters->persistent) && $parameters->persistent) {
$flags |= STREAM_CLIENT_PERSISTENT;
}
@@ -121,7 +121,7 @@ class StreamConnection extends AbstractConnection
$uri = "unix://{$parameters->path}";
$flags = STREAM_CLIENT_CONNECT;
if ($parameters->persistent === true) {
if ($parameters->persistent) {
$flags |= STREAM_CLIENT_PERSISTENT;
}