Skip to content

Commit

Permalink
Update PHPStan baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Nov 24, 2024
1 parent aee1586 commit a34863a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/scheduler/TaskScheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,6 @@ public function mainThreadHeartbeat(int $currentTick) : void{
}

private function isReady(int $currentTick) : bool{
if(!$this->queue->isEmpty()){
/** @phpstan-var TaskHandler<covariant Task> $current */
$current = $this->queue->current();
return $current->getNextRun() <= $currentTick;
}
return false;
return !$this->queue->isEmpty() && $this->queue->current()->getNextRun() <= $currentTick;
}
}
2 changes: 1 addition & 1 deletion tests/phpstan/configs/actual-problems.neon
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ parameters:
path: ../../../src/scheduler/BulkCurlTask.php

-
message: "#^Cannot call method getNextRun\\(\\) on array\\<string, int\\|pocketmine\\\\scheduler\\\\TaskHandler\\>\\|int\\|pocketmine\\\\scheduler\\\\TaskHandler\\.$#"
message: "#^Cannot call method getNextRun\\(\\) on array\\<string, int\\|pocketmine\\\\scheduler\\\\TaskHandler\\<covariant pocketmine\\\\scheduler\\\\Task\\>\\>\\|int\\|pocketmine\\\\scheduler\\\\TaskHandler\\<covariant pocketmine\\\\scheduler\\\\Task\\>\\.$#"
count: 1
path: ../../../src/scheduler/TaskScheduler.php

Expand Down

0 comments on commit a34863a

Please sign in to comment.