Browse Source

fine tune of code, detailed tests added

tags/0.8
Paul Rock 7 years ago
parent
commit
83408c0868
  1. 2
      src/Client.php
  2. 2
      src/Helpers/ArrayHelper.php
  3. 2
      src/SocketTrait.php

2
src/Client.php

@ -409,7 +409,7 @@ class Client implements Interfaces\ClientInterface
$this->openSocket(); $this->openSocket();
// If socket is active // If socket is active
if ($this->getSocket()) {
if (null !== $this->getSocket()) {
// If we logged in then exit from loop // If we logged in then exit from loop
if (true === $this->login()) { if (true === $this->login()) {

2
src/Helpers/ArrayHelper.php

@ -33,7 +33,7 @@ class ArrayHelper
{ {
$output = []; $output = [];
foreach ($keys as $key) { foreach ($keys as $key) {
if (!array_key_exists($key, $array) && empty($array[$key])) {
if (self::checkIfKeyNotExist($key, $array)) {
$output[] = $key; $output[] = $key;
} }
} }

2
src/SocketTrait.php

@ -38,7 +38,7 @@ trait SocketTrait
); );
// Throw error is socket is not initiated // Throw error is socket is not initiated
if (!$socket) {
if (false === $socket) {
throw new ClientException('Unable to establish socket session, ' . $this->_socket_err_str); throw new ClientException('Unable to establish socket session, ' . $this->_socket_err_str);
} }

Loading…
Cancel
Save