phpstan: green on level 4

This commit is contained in:
Dylan K. Taylor 2019-12-12 13:00:57 +00:00
parent 46930b98b7
commit 70c3008b7b
4 changed files with 99 additions and 1 deletions

View File

@ -1,12 +1,14 @@
includes: includes:
- tests/phpstan/configs/debug-const-checks.neon
- tests/phpstan/configs/gc-hacks.neon - tests/phpstan/configs/gc-hacks.neon
- tests/phpstan/configs/optional-com-dotnet.neon - tests/phpstan/configs/optional-com-dotnet.neon
- tests/phpstan/configs/optional-leveldb.neon - tests/phpstan/configs/optional-leveldb.neon
- tests/phpstan/configs/phpstan-bugs.neon - tests/phpstan/configs/phpstan-bugs.neon
- tests/phpstan/configs/pthreads-bugs.neon - tests/phpstan/configs/pthreads-bugs.neon
- tests/phpstan/configs/runtime-type-checks.neon
parameters: parameters:
level: 3 level: 4
autoload_files: autoload_files:
- tests/phpstan/bootstrap.php - tests/phpstan/bootstrap.php
- src/pocketmine/PocketMine.php - src/pocketmine/PocketMine.php

View File

@ -0,0 +1,21 @@
parameters:
ignoreErrors:
-
message: "#^If condition is always true\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^Ternary operator condition is always true\\.$#"
count: 1
path: ../../../src/pocketmine/Server.php
-
message: "#^If condition is always false\\.$#"
count: 1
path: ../../../src/pocketmine/updater/AutoUpdater.php
-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: ../../../src/pocketmine/updater/AutoUpdater.php

View File

@ -25,3 +25,47 @@ parameters:
message: "#^Offset \\(int\\|string\\) does not exist on array\\(\\)\\.$#" message: "#^Offset \\(int\\|string\\) does not exist on array\\(\\)\\.$#"
count: 1 count: 1
path: ../../../src/pocketmine/MemoryManager.php path: ../../../src/pocketmine/MemoryManager.php
-
message: "#^Comparison operation \"\\>\\=\" between 0 and 2 is always false\\.$#"
count: 1
path: ../../../src/pocketmine/block/Liquid.php
-
#adjacentSources comparison FP
message: "#^If condition is always false\\.$#"
count: 1
path: ../../../src/pocketmine/block/Liquid.php
-
#$class::NETWORK_ID false positive
message: "#^Strict comparison using \\!\\=\\= between \\-1 and \\-1 will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/entity/Entity.php
-
message: "#^Call to function assert\\(\\) with false and 'unknown hit type' will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/entity/projectile/Projectile.php
-
message: "#^Strict comparison using \\=\\=\\= between int\\<min, 3\\> and 4 will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/level/Level.php
-
message: "#^Instanceof between int and PharFileInfo will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/plugin/PharPluginLoader.php
-
#ReflectionFunction::getClosureThis() should be nullable
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Utils.php
-
#ReflectionFunction::getClosureScopeClass() should be nullable
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: ../../../src/pocketmine/utils/Utils.php

View File

@ -0,0 +1,31 @@
parameters:
ignoreErrors:
-
#::add() / ::remove() thread parameter
message: "#^If condition is always true\\.$#"
count: 2
path: ../../../src/pocketmine/ThreadManager.php
-
#::get() tags parameter
message: "#^If condition is always false\\.$#"
count: 1
path: ../../../src/pocketmine/item/ItemFactory.php
-
#::get() tags parameter
message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#"
count: 1
path: ../../../src/pocketmine/item/ItemFactory.php
-
#::get() tags parameter
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 1
path: ../../../src/pocketmine/item/ItemFactory.php
-
#->sendBlocks() blocks parameter
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 2
path: ../../../src/pocketmine/level/Level.php