phpstan: ignore more errors reported by strict-rules

This commit is contained in:
Dylan K. Taylor 2020-02-07 22:14:51 +00:00
parent 66a1134ca1
commit 2d461251ed
2 changed files with 38 additions and 0 deletions

View File

@ -21,6 +21,12 @@ parameters:
count: 1
path: ../../../src/Server.php
-
#dynamic instanceof
message: "#^Instanceof between pocketmine\\\\block\\\\tile\\\\Tile and class\\-string\\<pocketmine\\\\block\\\\tile\\\\Tile\\> will always evaluate to true\\.$#"
count: 1
path: ../../../src/block/Block.php
-
message: "#^Comparison operation \"\\>\\=\" between 0 and 2 is always false\\.$#"
count: 1
@ -60,11 +66,22 @@ parameters:
count: 1
path: ../../../src/network/mcpe/protocol/DataPacket.php
-
#object to array cast analysis bug
message: "#^Casting to string something that's already string\\.$#"
count: 1
path: ../../../src/network/mcpe/protocol/DataPacket.php
-
message: "#^If condition is always false\\.$#"
count: 1
path: ../../../src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php
-
message: "#^Instanceof between pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\entity\\\\MetadataProperty and pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\entity\\\\MetadataProperty will always evaluate to true\\.$#"
count: 1
path: ../../../src/network/mcpe/protocol/types/entity/EntityMetadataCollection.php
-
#phpstan doesn't understand that SplFixedArray may contain null
message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotNull\\(\\) with int and string will always evaluate to true\\.$#"

View File

@ -1,5 +1,20 @@
parameters:
ignoreErrors:
-
message: "#^Instanceof between pocketmine\\\\block\\\\utils\\\\BannerPattern and pocketmine\\\\block\\\\utils\\\\BannerPattern will always evaluate to true\\.$#"
count: 1
path: ../../../src/block/Banner.php
-
message: "#^Call to function assert\\(\\) with bool will always evaluate to true\\.$#"
count: 2
path: ../../../src/block/tile/TileFactory.php
-
message: "#^Call to function assert\\(\\) with bool will always evaluate to true\\.$#"
count: 2
path: ../../../src/entity/EntityFactory.php
-
message: "#^Instanceof between pocketmine\\\\event\\\\RegisteredListener and pocketmine\\\\event\\\\RegisteredListener will always evaluate to true\\.$#"
count: 1
@ -11,6 +26,12 @@ parameters:
count: 3
path: ../../../src/item/Item.php
-
#setLore()
message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#"
count: 1
path: ../../../src/item/Item.php
-
#commands plugin.yml not currently validated, can't be sure
message: "#^Call to function is_array\\(\\) with array\\<string, mixed\\> will always evaluate to true\\.$#"