diff --git a/src/Client.php b/src/Client.php index 752fdb2..85afe6b 100644 --- a/src/Client.php +++ b/src/Client.php @@ -409,7 +409,7 @@ class Client implements Interfaces\ClientInterface $this->openSocket(); // If socket is active - if ($this->getSocket()) { + if (null !== $this->getSocket()) { // If we logged in then exit from loop if (true === $this->login()) { diff --git a/src/Helpers/ArrayHelper.php b/src/Helpers/ArrayHelper.php index 8283e31..6be7090 100644 --- a/src/Helpers/ArrayHelper.php +++ b/src/Helpers/ArrayHelper.php @@ -33,7 +33,7 @@ class ArrayHelper { $output = []; foreach ($keys as $key) { - if (!array_key_exists($key, $array) && empty($array[$key])) { + if (self::checkIfKeyNotExist($key, $array)) { $output[] = $key; } } diff --git a/src/SocketTrait.php b/src/SocketTrait.php index d2c261c..5b1fc7a 100644 --- a/src/SocketTrait.php +++ b/src/SocketTrait.php @@ -38,7 +38,7 @@ trait SocketTrait ); // Throw error is socket is not initiated - if (!$socket) { + if (false === $socket) { throw new ClientException('Unable to establish socket session, ' . $this->_socket_err_str); }