Skip to content

Commit

Permalink
Merge pull request #5 from nicchap/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
nicchap authored Oct 15, 2018
2 parents f0bfa2d + bddd97a commit 610ec5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Ami.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ public function __construct($config = null, array $optconfig = [])
* @return array of parameters, empty if invalid socket resource
*/
public function sendRequest($action, array $parameters = [])
{
if (!is_resource($this->socket))
{
if (!is_resource($this->socket)) {
return [];
}

$req = 'Action: '.$action."\r\n";
foreach ($parameters as $var => $val) {
Expand Down Expand Up @@ -198,8 +199,9 @@ public function sendRequest($action, array $parameters = [])
*/
public function waitResponse($allowTimeout = false)
{
if (!is_resource($this->socket))
if (!is_resource($this->socket)) {
return [];
}

// make sure we haven't already timed out
$info = stream_get_meta_data($this->socket);
Expand Down

0 comments on commit 610ec5a

Please sign in to comment.