phpdoc & closure improvements

This commit is contained in:
Steffen Schröder
2014-05-27 22:25:55 +02:00
parent 683e6f30a2
commit 0a7bc3b234
3 changed files with 10 additions and 16 deletions

View File

@ -310,21 +310,21 @@ class ManiaExchangeManager {
$success = $this->maniaControl->fileReader->loadFile($url, function ($mapInfo, $error) use (&$function, $titlePrefix) {
if ($error) {
trigger_error($error);
return null;
return;
}
$mxMapList = json_decode($mapInfo);
if (!isset($mxMapList->results)) {
trigger_error('Cannot decode searched JSON data');
return null;
return;
}
$mxMapList = $mxMapList->results;
if ($mxMapList === null) {
trigger_error('Cannot decode searched JSON data');
return null;
return;
}
$maps = array();
@ -335,7 +335,6 @@ class ManiaExchangeManager {
}
call_user_func($function, $maps);
return true;
}, "application/json");
return $success;