Skip to content

Commit

Permalink
Please PHPStan.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxkDev committed Sep 3, 2021
1 parent 808da34 commit 6c5d226
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/JaxkDev/DiscordBot/Communication/BotThread.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ protected function checkDependencyConflicts(): void{
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, cannot find file at '$file'.");
}
$installed = json_decode(file_get_contents($file), true);
$data = file_get_contents($file);
if($data === false){
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, failed to get file contents from '$file'.");
}
$installed = json_decode($data, true);
if($installed === null){
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, unable to parse composer installed.json at '$file'.");
Expand All @@ -88,7 +93,12 @@ protected function checkDependencyConflicts(): void{
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, cannot find file at '$file'.");
}
$installed = json_decode(file_get_contents($file), true);
$data = file_get_contents($file);
if($data === false){
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, failed to get file contents from '$file'.");
}
$installed = json_decode($data, true);
if($installed === null){
$this->setStatus(self::STATUS_CLOSED);
throw new \RuntimeException("Failed to check dependency conflicts with pocketmine, unable to parse composer installed.json at '$file'.");
Expand Down

0 comments on commit 6c5d226

Please sign in to comment.