From 0ff0b330471bf9c243838b53d5365b08cf30ad9e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 11 Sep 2020 20:56:18 +0100 Subject: [PATCH] StatusCommand: avoid modulo operator on float this was detected by a custom PHPStan extension. --- src/pocketmine/command/defaults/StatusCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/command/defaults/StatusCommand.php b/src/pocketmine/command/defaults/StatusCommand.php index 60d49c2dc..85669451f 100644 --- a/src/pocketmine/command/defaults/StatusCommand.php +++ b/src/pocketmine/command/defaults/StatusCommand.php @@ -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;