mirror of
https://github.com/predis/predis.git
synced 2026-08-31 12:43:31 +00:00
Remove a few unnecessary strict comparisons.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user