Fixed PHPStan complaints

This commit is contained in:
Dylan K. Taylor 2021-11-30 00:36:38 +00:00
parent 6f8f460a6c
commit f239b077b9
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\console;
use pocketmine\utils\AssumptionFailedError;
use function fclose;
use function fgets;
use function fopen;
@ -44,7 +45,9 @@ final class ConsoleReader{
fclose($this->stdin);
}
$this->stdin = fopen("php://stdin", "r");
$stdin = fopen("php://stdin", "r");
if($stdin === false) throw new AssumptionFailedError("Opening stdin should never fail");
$this->stdin = $stdin;
}
/**

View File

@ -505,6 +505,11 @@ parameters:
count: 1
path: ../../../src/command/defaults/TimingsCommand.php
-
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 2
path: ../../../src/console/ConsoleReader.php
-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
count: 1