StatusCommand: avoid modulo operator on float

this was detected by a custom PHPStan extension.
This commit is contained in:
Dylan K. Taylor 2020-09-11 20:56:18 +01:00
parent 114df07622
commit 0ff0b33047

View File

@ -54,9 +54,9 @@ class StatusCommand extends VanillaCommand{
$server = $sender->getServer();
$sender->sendMessage(TextFormat::GREEN . "---- " . TextFormat::WHITE . "Server status" . TextFormat::GREEN . " ----");
$time = microtime(true) - \pocketmine\START_TIME;
$time = (int) (microtime(true) - \pocketmine\START_TIME);
$seconds = floor($time % 60);
$seconds = $time % 60;
$minutes = null;
$hours = null;
$days = null;