Rail: specify type for local static variable

fixes a phpstan level 7 error
phpstan doesn't make any assumptions about local static variable types because analysing them would require too much work, apparently.
This commit is contained in:
Dylan K. Taylor 2020-06-15 22:47:20 +01:00
parent 62ea7c93a9
commit 04191ec44a
2 changed files with 1 additions and 5 deletions

View File

@ -71,6 +71,7 @@ class Rail extends BaseRail{
}
protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{
/** @var int[] $horizontal */
static $horizontal = [
Vector3::SIDE_NORTH,
Vector3::SIDE_SOUTH,

View File

@ -275,11 +275,6 @@ parameters:
count: 3
path: ../../../src/pocketmine/block/Mycelium.php
-
message: "#^Method pocketmine\\\\block\\\\Rail\\:\\:getPossibleConnectionDirectionsOneConstraint\\(\\) should return array\\<int, true\\> but returns array\\<int\\|string, true\\>\\.$#"
count: 1
path: ../../../src/pocketmine/block/Rail.php
-
message: "#^Parameter \\#2 \\$x of static method pocketmine\\\\level\\\\generator\\\\object\\\\Tree\\:\\:growTree\\(\\) expects int, float\\|int given\\.$#"
count: 2