phpstan: separate non-PM bugs from the main neon config

everything left in here is now a PM problem that needs to be looked into.
This commit is contained in:
Dylan K. Taylor 2019-12-01 20:12:41 +00:00
parent 3226a9dc6a
commit 15f8886958
5 changed files with 63 additions and 52 deletions

View File

@ -1,4 +1,8 @@
includes:
- tests/phpstan/configs/optional-com-dotnet.neon
- tests/phpstan/configs/optional-leveldb.neon
- tests/phpstan/configs/phpstan-bugs.neon
- tests/phpstan/configs/pthreads-bugs.neon
parameters:
level: 2
@ -57,28 +61,11 @@ parameters:
count: 1
path: src/pocketmine/network/mcpe/protocol/StartGamePacket.php
-
message: "#^Instantiated class COM not found\\.$#"
count: 2
path: src/pocketmine/network/upnp/UPnP.php
comment: "only available on Windows"
-
message: "#^Access to property \\$StaticPortMappingCollection on an unknown class COM\\.$#"
count: 4
path: src/pocketmine/network/upnp/UPnP.php
comment: "only available on Windows"
-
message: "#^Constructor of class pocketmine\\\\scheduler\\\\TaskScheduler has an unused parameter \\$logger\\.$#"
count: 1
path: src/pocketmine/scheduler/TaskScheduler.php
-
message: "#^Variable \\$GLOBALS in isset\\(\\) always exists and is not nullable\\.$#"
path: src/pocketmine/MemoryManager.php
comment: "this isn't defined on threads (thanks pthreads)"
-
message: "#^Constant pocketmine\\\\COMPOSER_AUTOLOADER_PATH not found\\.$#"
path: src/pocketmine
@ -110,40 +97,6 @@ parameters:
-
message: "#^Constant pocketmine\\\\VERSION not found\\.$#"
path: src/pocketmine
-
message: "#^Used constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
comment: "explicitly checked"
-
message: "#^Constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
comment: "explicitly checked"
-
message: "#^Instantiated class LevelDB not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
comment: "leveldb extension currently optional"
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:createDB\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:getDatabase\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Property pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:\\$db has unknown class LevelDB as its type\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Call to method (get|put|delete|close)\\(\\) on an unknown class LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^PHPDoc tag @param has invalid value \\(.+\\)\\: Unexpected token \"&\", expected TOKEN_VARIABLE at offset \\d+$#"
path: src/pocketmine
comment: "phpstan stupidity"
-
message: "#^Default value of the parameter \\#\\d+ \\$[A-Za-z\\d_]+ \\(\\-?\\d+\\) of method .+\\(\\) is incompatible with type float\\.$#"
path: src/pocketmine
comment: "phpstan bug"
-
message: "#^Call to an undefined method pocketmine\\\\command\\\\CommandSender\\:\\:teleport\\(\\)\\.$#"

View File

@ -0,0 +1,12 @@
parameters:
ignoreErrors:
-
message: "#^Instantiated class COM not found\\.$#"
count: 2
path: src/pocketmine/network/upnp/UPnP.php
-
message: "#^Access to property \\$StaticPortMappingCollection on an unknown class COM\\.$#"
count: 4
path: src/pocketmine/network/upnp/UPnP.php

View File

@ -0,0 +1,30 @@
parameters:
ignoreErrors:
-
message: "#^Used constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Constant LEVELDB_ZLIB_RAW_COMPRESSION not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Instantiated class LevelDB not found\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:createDB\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Return typehint of method pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:getDatabase\\(\\) has invalid type LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Property pocketmine\\\\level\\\\format\\\\io\\\\leveldb\\\\LevelDB\\:\\:\\$db has unknown class LevelDB as its type\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php
-
message: "#^Call to method (get|put|delete|close)\\(\\) on an unknown class LevelDB\\.$#"
path: src/pocketmine/level/format/io/leveldb/LevelDB.php

View File

@ -0,0 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^PHPDoc tag @param has invalid value \\(.+\\)\\: Unexpected token \"&\", expected TOKEN_VARIABLE at offset \\d+$#"
path: src/pocketmine
-
message: "#^Default value of the parameter \\#\\d+ \\$[A-Za-z\\d_]+ \\(\\-?\\d+\\) of method .+\\(\\) is incompatible with type float\\.$#"
path: src/pocketmine

View File

@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Variable \\$GLOBALS in isset\\(\\) always exists and is not nullable\\.$#"
path: src/pocketmine/MemoryManager.php