diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cd3c5b18b..8c45f8158 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -7,7 +7,6 @@ includes: - tests/phpstan/configs/l8-baseline.neon - tests/phpstan/configs/php-bugs.neon - tests/phpstan/configs/phpstan-bugs.neon - - tests/phpstan/configs/phpunit-wiring-tests.neon - tests/phpstan/configs/pthreads-bugs.neon - tests/phpstan/configs/runtime-type-checks.neon - vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/tests/phpstan/configs/gc-hacks.neon b/tests/phpstan/configs/gc-hacks.neon index 4e854c21b..37ac037f1 100644 --- a/tests/phpstan/configs/gc-hacks.neon +++ b/tests/phpstan/configs/gc-hacks.neon @@ -35,13 +35,3 @@ parameters: count: 1 path: ../../../src/entity/Living.php - - - message: "#^Property pocketmine\\\\player\\\\Player\\:\\:\\$craftingGrid \\(pocketmine\\\\crafting\\\\CraftingGrid\\) does not accept null\\.$#" - count: 1 - path: ../../../src/player/Player.php - - - - message: "#^Property pocketmine\\\\player\\\\Player\\:\\:\\$cursorInventory \\(pocketmine\\\\inventory\\\\PlayerCursorInventory\\) does not accept null\\.$#" - count: 1 - path: ../../../src/player/Player.php - diff --git a/tests/phpstan/configs/l7-baseline.neon b/tests/phpstan/configs/l7-baseline.neon index b5781fdfe..f7e9f17e7 100644 --- a/tests/phpstan/configs/l7-baseline.neon +++ b/tests/phpstan/configs/l7-baseline.neon @@ -430,11 +430,6 @@ parameters: count: 1 path: ../../../src/block/tile/TileFactory.php - - - message: "#^Property pocketmine\\\\console\\\\ConsoleReader\\:\\:\\$stdin \\(resource\\) does not accept resource\\|false\\.$#" - count: 1 - path: ../../../src/console/ConsoleReader.php - - message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#" count: 1 @@ -465,6 +460,11 @@ parameters: count: 1 path: ../../../src/command/defaults/TimingsCommand.php + - + message: "#^Property pocketmine\\\\console\\\\ConsoleReader\\:\\:\\$stdin \\(resource\\) does not accept resource\\|false\\.$#" + count: 1 + path: ../../../src/console/ConsoleReader.php + - message: "#^Method pocketmine\\\\crafting\\\\CraftingManager\\:\\:hashOutputs\\(\\) should return string but returns string\\|false\\.$#" count: 1 @@ -575,16 +575,6 @@ parameters: count: 1 path: ../../../src/lang/Language.php - - - message: "#^Parameter \\#1 \\$str of static method pocketmine\\\\network\\\\mcpe\\\\JwtUtils\\:\\:b64UrlEncode\\(\\) expects string, string\\|false given\\.$#" - count: 2 - path: ../../../src/network/mcpe/JwtUtils.php - - - - message: "#^Parameter \\#1 \\$string of method Mdanter\\\\Ecc\\\\Serializer\\\\PublicKey\\\\DerPublicKeySerializer\\:\\:parse\\(\\) expects string, string\\|false given\\.$#" - count: 1 - path: ../../../src/network/mcpe/auth/ProcessLoginTask.php - - message: "#^Parameter \\#1 \\$buffer of static method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:decoder\\(\\) expects string, string\\|false given\\.$#" count: 1 @@ -595,36 +585,6 @@ parameters: count: 1 path: ../../../src/network/mcpe/encryption/EncryptionUtils.php - - - message: "#^Parameter \\#1 \\$x of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putSignedBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php - - - - message: "#^Parameter \\#2 \\$y of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putSignedBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php - - - - message: "#^Parameter \\#3 \\$z of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putSignedBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/entity/BlockPosMetadataProperty.php - - - - message: "#^Parameter \\#1 \\$x of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php - - - - message: "#^Parameter \\#2 \\$y of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php - - - - message: "#^Parameter \\#3 \\$z of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putBlockPosition\\(\\) expects int, float\\|int given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/inventory/UseItemTransactionData.php - - message: "#^Method pocketmine\\\\resourcepacks\\\\ZippedResourcePack\\:\\:getPackChunk\\(\\) should return string but returns string\\|false\\.$#" count: 1 diff --git a/tests/phpstan/configs/l8-baseline.neon b/tests/phpstan/configs/l8-baseline.neon index 6e5d7a4fe..a21403ea7 100644 --- a/tests/phpstan/configs/l8-baseline.neon +++ b/tests/phpstan/configs/l8-baseline.neon @@ -190,31 +190,6 @@ parameters: count: 1 path: ../../../src/network/mcpe/NetworkSession.php - - - message: "#^Parameter \\#1 \\$eid of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putEntityUniqueId\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/SetScorePacket.php - - - - message: "#^Parameter \\#1 \\$v of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putString\\(\\) expects string, string\\|null given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/SetScorePacket.php - - - - message: "#^Parameter \\#1 \\$eid of method pocketmine\\\\network\\\\mcpe\\\\protocol\\\\serializer\\\\PacketSerializer\\:\\:putEntityUniqueId\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/SetScoreboardIdentityPacket.php - - - - message: "#^Parameter \\#1 \\$v of method pocketmine\\\\utils\\\\BinaryStream\\:\\:putVarInt\\(\\) expects int, int\\|null given\\.$#" - count: 1 - path: ../../../src/network/mcpe/protocol/types/recipe/FurnaceRecipe.php - - - - message: "#^Property pocketmine\\\\network\\\\mcpe\\\\raklib\\\\RakLibServer\\:\\:\\$mainThreadNotifier \\(pocketmine\\\\snooze\\\\SleeperNotifier\\) does not accept pocketmine\\\\snooze\\\\SleeperNotifier\\|null\\.$#" - count: 1 - path: ../../../src/network/mcpe/raklib/RakLibServer.php - - message: "#^Method pocketmine\\\\permission\\\\DefaultPermissions\\:\\:registerPermission\\(\\) should return pocketmine\\\\permission\\\\Permission but returns pocketmine\\\\permission\\\\Permission\\|null\\.$#" count: 1 diff --git a/tests/phpstan/configs/php-bugs.neon b/tests/phpstan/configs/php-bugs.neon index b0d65acb6..f4754087b 100644 --- a/tests/phpstan/configs/php-bugs.neon +++ b/tests/phpstan/configs/php-bugs.neon @@ -1,15 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Method ReflectionMethod\\:\\:getClosure\\(\\) invoked with 0 parameters, 1 required\\.$#" - count: 2 - path: ../../phpunit/event/HandlerListManagerTest.php - - - - message: "#^Method ReflectionMethod\\:\\:getClosure\\(\\) invoked with 0 parameters, 1 required\\.$#" - count: 1 - path: ../../phpunit/network/mcpe/handler/StupidJsonDecodeTest.php - - message: "#^Property pocketmine\\\\network\\\\mcpe\\\\handler\\\\StupidJsonDecodeTest\\:\\:\\$stupidJsonDecodeFunc \\(Closure\\(string, bool\\)\\: mixed\\) does not accept Closure\\|null\\.$#" count: 1 diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 3e0dab33b..a4bff81f0 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -10,11 +10,6 @@ parameters: count: 2 path: ../../../src/console/ConsoleReader.php - - - message: "#^Parameter \\#1 \\$command of function proc_open expects string, array\\ given\\.$#" - count: 1 - path: ../../../src/console/ConsoleReaderThread.php - - message: "#^Method pocketmine\\\\crafting\\\\CraftingManager\\:\\:getDestructorCallbacks\\(\\) should return pocketmine\\\\utils\\\\ObjectSet\\ but returns pocketmine\\\\utils\\\\ObjectSet\\\\|pocketmine\\\\utils\\\\ObjectSet\\\\.$#" count: 1 diff --git a/tests/phpstan/configs/phpunit-wiring-tests.neon b/tests/phpstan/configs/phpunit-wiring-tests.neon deleted file mode 100644 index 40cbef80d..000000000 --- a/tests/phpstan/configs/phpunit-wiring-tests.neon +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Parameter \\#1 \\$class of method pocketmine\\\\world\\\\format\\\\io\\\\WorldProviderManager\\:\\:addProvider\\(\\) expects class\\-string\\, string given\\.$#" - count: 2 - path: ../../phpunit/world/format/io/LevelProviderManagerTest.php -