mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
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:
@ -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"];
|
||||
|
Reference in New Issue
Block a user