1
1
Fork 0

Unified return value types

This commit is contained in:
Michael 2019-10-05 04:50:29 +00:00
parent aa75e749be
commit af5527f896

View file

@ -402,13 +402,13 @@ class GServer
$curlResult = Network::curl($nodeinfo_url); $curlResult = Network::curl($nodeinfo_url);
if (!$curlResult->isSuccess()) { if (!$curlResult->isSuccess()) {
return false; return [];
} }
$nodeinfo = json_decode($curlResult->getBody(), true); $nodeinfo = json_decode($curlResult->getBody(), true);
if (!is_array($nodeinfo)) { if (!is_array($nodeinfo)) {
return false; return [];
} }
$server = []; $server = [];
@ -461,8 +461,8 @@ class GServer
} }
} }
if (!$server) { if (empty($server)) {
return false; return [];
} }
return $server; return $server;
@ -479,13 +479,13 @@ class GServer
{ {
$curlResult = Network::curl($nodeinfo_url); $curlResult = Network::curl($nodeinfo_url);
if (!$curlResult->isSuccess()) { if (!$curlResult->isSuccess()) {
return false; return [];
} }
$nodeinfo = json_decode($curlResult->getBody(), true); $nodeinfo = json_decode($curlResult->getBody(), true);
if (!is_array($nodeinfo)) { if (!is_array($nodeinfo)) {
return false; return [];
} }
$server = []; $server = [];
@ -539,7 +539,7 @@ class GServer
} }
if (empty($server)) { if (empty($server)) {
return false; return [];
} }
return $server; return $server;