Skip to content

Commit

Permalink
Merge pull request #159 from AlessandroMinoccheri/semplify_returns
Browse files Browse the repository at this point in the history
simplified return statement
  • Loading branch information
WillSewell authored Apr 23, 2018
2 parents e3b258a + c436e84 commit da7cd12
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/Pusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ public static function array_implode($glue, $separator, $array)
if (!is_array($array)) {
return $array;
}

$string = array();
foreach ($array as $key => $val) {
if (is_array($val)) {
Expand Down Expand Up @@ -451,11 +452,13 @@ public function trigger($channels, $event, $data, $socket_id = null, $debug = fa

if ($response['status'] === 200 && $debug === false) {
return true;
} elseif ($debug === true || $this->settings['debug'] === true) {
}

if ($debug === true || $this->settings['debug'] === true) {
return $response;
} else {
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -498,11 +501,13 @@ public function triggerBatch($batch = array(), $debug = false, $already_encoded

if ($response['status'] === 200 && $debug === false) {
return true;
} elseif ($debug === true || $this->settings['debug'] === true) {
}

if ($debug === true || $this->settings['debug'] === true) {
return $response;
} else {
return false;
}

return false;
}

/**
Expand Down Expand Up @@ -661,10 +666,12 @@ public function notify($interests, $data = array(), $debug = false)

if ($response['status'] === 202 && $debug === false) {
return true;
} elseif ($debug === true || $this->settings['debug'] === true) {
}

if ($debug === true || $this->settings['debug'] === true) {
return $response;
} else {
return false;
}

return false;
}
}

0 comments on commit da7cd12

Please sign in to comment.