diff --git a/src/console/ConsoleCommandSender.php b/src/console/ConsoleCommandSender.php index 3879ab016..0858b8ec8 100644 --- a/src/console/ConsoleCommandSender.php +++ b/src/console/ConsoleCommandSender.php @@ -39,7 +39,10 @@ class ConsoleCommandSender implements CommandSender{ /** @var Server */ private $server; - /** @var int|null */ + /** + * @var int|null + * @phpstan-var positive-int|null + */ protected $lineHeight = null; /** @var Language */ private $language; diff --git a/src/player/Player.php b/src/player/Player.php index 7cf4388d1..59ffaa5a2 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -253,6 +253,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ protected bool $blockCollision = true; protected bool $flying = false; + /** @phpstan-var positive-int|null */ protected ?int $lineHeight = null; protected string $locale = "en_US"; diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 99fcbe5e6..ef6d89670 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -5,6 +5,11 @@ parameters: count: 1 path: ../../../src/block/BaseBanner.php + - + message: "#^Comparison operation \"\\<\" between int\\<1, max\\> and 1 is always false\\.$#" + count: 1 + path: ../../../src/console/ConsoleCommandSender.php + - message: "#^Method pocketmine\\\\crafting\\\\CraftingManager\\:\\:getDestructorCallbacks\\(\\) should return pocketmine\\\\utils\\\\ObjectSet\\ but returns pocketmine\\\\utils\\\\ObjectSet\\\\|pocketmine\\\\utils\\\\ObjectSet\\\\.$#" count: 1 @@ -20,6 +25,11 @@ parameters: count: 1 path: ../../../src/entity/projectile/Projectile.php + - + message: "#^Comparison operation \"\\<\" between int\\<1, max\\> and 1 is always false\\.$#" + count: 1 + path: ../../../src/player/Player.php + - message: "#^Dead catch \\- RuntimeException is never thrown in the try block\\.$#" count: 1