From 46c57e4e244a31ffeb5462752b52f0c886729a1e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 11 Oct 2020 11:35:03 +0100 Subject: [PATCH] TimingsCommand: fixed crash on result handling since AsyncTask->getResult() returns mixed, phpstan has no idea what is being returned here, so it doesn't report any errors. --- src/command/defaults/TimingsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/defaults/TimingsCommand.php b/src/command/defaults/TimingsCommand.php index c953438f1..98204167a 100644 --- a/src/command/defaults/TimingsCommand.php +++ b/src/command/defaults/TimingsCommand.php @@ -163,7 +163,7 @@ class TimingsCommand extends VanillaCommand{ $sender->getServer()->getLogger()->logException($result); return; } - $response = json_decode($result[0], true); + $response = json_decode($result->getBody(), true); if(is_array($response) && isset($response["id"])){ Command::broadcastCommandMessage($sender, new TranslationContainer("pocketmine.command.timings.timingsRead", ["https://" . $this->host . "/?id=" . $response["id"]]));