diff --git a/src/scheduler/TaskScheduler.php b/src/scheduler/TaskScheduler.php index 5375f089e40..3e2b089c6c5 100644 --- a/src/scheduler/TaskScheduler.php +++ b/src/scheduler/TaskScheduler.php @@ -184,11 +184,6 @@ public function mainThreadHeartbeat(int $currentTick) : void{ } private function isReady(int $currentTick) : bool{ - if(!$this->queue->isEmpty()){ - /** @phpstan-var TaskHandler $current */ - $current = $this->queue->current(); - return $current->getNextRun() <= $currentTick; - } - return false; + return !$this->queue->isEmpty() && $this->queue->current()->getNextRun() <= $currentTick; } } diff --git a/tests/phpstan/configs/actual-problems.neon b/tests/phpstan/configs/actual-problems.neon index e778cf0047f..f37d2387841 100644 --- a/tests/phpstan/configs/actual-problems.neon +++ b/tests/phpstan/configs/actual-problems.neon @@ -801,7 +801,7 @@ parameters: path: ../../../src/scheduler/BulkCurlTask.php - - message: "#^Cannot call method getNextRun\\(\\) on array\\\\|int\\|pocketmine\\\\scheduler\\\\TaskHandler\\.$#" + message: "#^Cannot call method getNextRun\\(\\) on array\\\\>\\|int\\|pocketmine\\\\scheduler\\\\TaskHandler\\\\.$#" count: 1 path: ../../../src/scheduler/TaskScheduler.php