Internet: make getURL() and postURL() return InternetRequestResult objects

this reduces the amount of reference parameters, and generally reduces the number of parameters, while guaranteeing consistency of the APIs.
This commit is contained in:
Dylan K. Taylor
2020-10-09 18:03:20 +01:00
parent 15cd354b98
commit 40fca0936f
5 changed files with 82 additions and 39 deletions

View File

@ -50,8 +50,8 @@ class UpdateCheckTask extends AsyncTask{
$response = Internet::getURL($this->endpoint . "?channel=" . $this->channel, 4, [], $error);
$this->error = $error;
if($response !== false){
$response = json_decode($response, true);
if($response !== null){
$response = json_decode($response->getBody(), true);
if(is_array($response)){
if(isset($response["error"]) and is_string($response["error"])){
$this->error = $response["error"];