Merge branch 'stable'

# Conflicts:
#	resources/vanilla
#	src/pocketmine/block/Cake.php
This commit is contained in:
Dylan K. Taylor 2020-06-18 18:10:27 +01:00
commit 2687e63645
2 changed files with 474 additions and 0 deletions

View File

@ -1,5 +1,6 @@
includes:
- tests/phpstan/configs/actual-problems.neon
- tests/phpstan/configs/check-explicit-mixed-baseline.neon
- tests/phpstan/configs/com-dotnet-magic.neon
- tests/phpstan/configs/custom-leveldb.neon
- tests/phpstan/configs/ds-bugs.neon
@ -20,6 +21,7 @@ rules:
parameters:
level: 8
checkExplicitMixed: true
bootstrapFiles:
- tests/phpstan/bootstrap.php
scanFiles:

View File

@ -0,0 +1,472 @@
parameters:
ignoreErrors:
-
message: "#^Cannot access offset string on mixed\\.$#"
count: 1
path: ../../../src/CrashDump.php
-
message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, mixed given\\.$#"
count: 1
path: ../../../src/CrashDump.php
-
message: "#^Cannot access offset float\\|int on mixed\\.$#"
count: 1
path: ../../../src/CrashDump.php
-
message: "#^Parameter \\#1 \\$path of static method pocketmine\\\\utils\\\\Filesystem\\:\\:cleanPath\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/CrashDump.php
-
message: "#^Cannot access offset 'name' on mixed\\.$#"
count: 1
path: ../../../src/CrashDump.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 7
path: ../../../src/MemoryManager.php
-
message: "#^Cannot access offset 'git' on mixed\\.$#"
count: 2
path: ../../../src/PocketMine.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 6
path: ../../../src/Server.php
-
message: "#^Parameter \\#2 \\$defaultValue of method pocketmine\\\\ServerConfigGroup\\:\\:getConfigString\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Cannot cast mixed to float\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Parameter \\#1 \\$array of static method pocketmine\\\\plugin\\\\PluginGraylist\\:\\:fromArray\\(\\) expects array, mixed given\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Parameter \\#2 \\$endpoint of class pocketmine\\\\updater\\\\AutoUpdater constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Parameter \\#1 \\$reason of method pocketmine\\\\network\\\\NetworkSessionManager\\:\\:close\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
path: ../../../src/Server.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: ../../../src/ServerConfigGroup.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: ../../../src/ServerConfigGroup.php
-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
count: 1
path: ../../../src/ServerConfigGroup.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: ../../../src/command/CommandReader.php
-
message: "#^Parameter \\#2 \\$host of class class@anonymous/src/command/defaults/TimingsCommand\\.php\\:125 constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/command/defaults/TimingsCommand.php
-
message: "#^Cannot access offset 0 on mixed\\.$#"
count: 1
path: ../../../src/command/defaults/TimingsCommand.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: ../../../src/command/defaults/VanillaCommand.php
-
message: "#^Cannot cast mixed to float\\.$#"
count: 1
path: ../../../src/command/defaults/VanillaCommand.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: ../../../src/crafting/CraftingManagerFromDataHelper.php
-
message: "#^Method pocketmine\\\\event\\\\EventPriority\\:\\:fromString\\(\\) should return int but returns mixed\\.$#"
count: 1
path: ../../../src/event/EventPriority.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: ../../../src/inventory/CreativeInventory.php
-
message: "#^Parameter \\#1 \\$id of static method pocketmine\\\\item\\\\enchantment\\\\Enchantment\\:\\:get\\(\\) expects int, mixed given\\.$#"
count: 1
path: ../../../src/item/enchantment/Enchantment.php
-
message: "#^Parameter \\#1 \\$result of method pocketmine\\\\network\\\\mcpe\\\\compression\\\\CompressBatchPromise\\:\\:resolve\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/network/mcpe/ChunkRequestTask.php
-
message: "#^Parameter \\#1 \\$result of method pocketmine\\\\network\\\\mcpe\\\\compression\\\\CompressBatchPromise\\:\\:resolve\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/network/mcpe/compression/CompressBatchTask.php
-
message: "#^Cannot access offset 'geometry' on mixed\\.$#"
count: 3
path: ../../../src/network/mcpe/convert/LegacySkinAdapter.php
-
message: "#^Method pocketmine\\\\network\\\\mcpe\\\\raklib\\\\PthreadsChannelReader\\:\\:read\\(\\) should return string\\|null but returns mixed\\.$#"
count: 1
path: ../../../src/network/mcpe/raklib/PthreadsChannelReader.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: ../../../src/network/mcpe/raklib/RakLibInterface.php
-
message: "#^Cannot access offset 'down' on mixed\\.$#"
count: 1
path: ../../../src/network/mcpe/raklib/RakLibInterface.php
-
message: "#^Cannot access offset 'up' on mixed\\.$#"
count: 1
path: ../../../src/network/mcpe/raklib/RakLibInterface.php
-
message: "#^Parameter \\#1 \\$value of static method pocketmine\\\\permission\\\\PermissionParser\\:\\:defaultFromString\\(\\) expects bool\\|string, mixed given\\.$#"
count: 1
path: ../../../src/permission/PermissionParser.php
-
message: "#^Parameter \\#2 \\$description of class pocketmine\\\\permission\\\\Permission constructor expects string\\|null, mixed given\\.$#"
count: 1
path: ../../../src/permission/PermissionParser.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: ../../../src/player/Player.php
-
message: "#^Parameter \\#1 \\.\\.\\.\\$slots of method pocketmine\\\\inventory\\\\BaseInventory\\:\\:addItem\\(\\) expects pocketmine\\\\item\\\\Item, mixed given\\.$#"
count: 1
path: ../../../src/player/Player.php
-
message: "#^Parameter \\#1 \\$description of method pocketmine\\\\command\\\\Command\\:\\:setDescription\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginBase.php
-
message: "#^Parameter \\#1 \\$usage of method pocketmine\\\\command\\\\Command\\:\\:setUsage\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginBase.php
-
message: "#^Parameter \\#1 \\$permissionMessage of method pocketmine\\\\command\\\\Command\\:\\:setPermissionMessage\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginBase.php
-
message: "#^Parameter \\#1 \\$plugin of method pocketmine\\\\plugin\\\\PluginDescription\\:\\:loadMap\\(\\) expects array, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Property pocketmine\\\\plugin\\\\PluginDescription\\:\\:\\$name \\(string\\) does not accept mixed\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 4
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Property pocketmine\\\\plugin\\\\PluginDescription\\:\\:\\$main \\(string\\) does not accept mixed\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$haystack of function stripos expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$name of static method pocketmine\\\\plugin\\\\PluginLoadOrder\\:\\:fromString\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Array \\(array\\<string\\>\\) does not accept mixed\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$data of static method pocketmine\\\\permission\\\\PermissionParser\\:\\:loadPermissions\\(\\) expects array\\<string, array\\<string, mixed\\>\\>, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Method pocketmine\\\\plugin\\\\PluginDescription\\:\\:getRequiredExtensions\\(\\) should return array\\<string, array\\<int, string\\>\\> but returns array\\<string, array\\<int, mixed\\>\\>\\.$#"
count: 1
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$str of function substr expects string, mixed given\\.$#"
count: 2
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Part \\$constr \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 2
path: ../../../src/plugin/PluginDescription.php
-
message: "#^Parameter \\#1 \\$plugins of class pocketmine\\\\plugin\\\\PluginGraylist constructor expects array\\<string\\>, mixed given\\.$#"
count: 1
path: ../../../src/plugin/PluginGraylist.php
-
message: "#^Part \\$openResult \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: ../../../src/resourcepacks/ZippedResourcePack.php
-
message: "#^Parameter \\#2 \\$code of class pocketmine\\\\resourcepacks\\\\ResourcePackException constructor expects int, mixed given\\.$#"
count: 1
path: ../../../src/resourcepacks/ZippedResourcePack.php
-
message: "#^Property pocketmine\\\\scheduler\\\\AsyncTask\\:\\:\\$result \\(bool\\|float\\|int\\|string\\|null\\) does not accept mixed\\.$#"
count: 1
path: ../../../src/scheduler/AsyncTask.php
-
message: "#^Parameter \\#1 \\$str of function igbinary_unserialize expects string, mixed given\\.$#"
count: 1
path: ../../../src/scheduler/AsyncTask.php
-
message: "#^Method pocketmine\\\\thread\\\\ThreadManager\\:\\:getAll\\(\\) should return array\\<pocketmine\\\\thread\\\\Thread\\|pocketmine\\\\thread\\\\Worker\\> but returns array\\.$#"
count: 1
path: ../../../src/thread/ThreadManager.php
-
message: "#^Method pocketmine\\\\timings\\\\TimingsHandler\\:\\:time\\(\\) should return TClosureReturn but returns TClosureReturn\\.$#"
count: 1
path: ../../../src/timings/TimingsHandler.php
-
message: "#^Parameter \\#2 \\$timestamp of function date expects int, mixed given\\.$#"
count: 1
path: ../../../src/updater/AutoUpdater.php
-
message: "#^Parameter \\#1 \\$baseVersion of class pocketmine\\\\utils\\\\VersionString constructor expects string, mixed given\\.$#"
count: 1
path: ../../../src/updater/AutoUpdater.php
-
message: "#^Parameter \\#2 \\$isDevBuild of class pocketmine\\\\utils\\\\VersionString constructor expects bool, mixed given\\.$#"
count: 1
path: ../../../src/updater/AutoUpdater.php
-
message: "#^Parameter \\#3 \\$buildNumber of class pocketmine\\\\utils\\\\VersionString constructor expects int, mixed given\\.$#"
count: 1
path: ../../../src/updater/AutoUpdater.php
-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
count: 1
path: ../../../src/updater/AutoUpdater.php
-
message: "#^Parameter \\#1 \\$updateInfo of method pocketmine\\\\updater\\\\AutoUpdater\\:\\:checkUpdateCallback\\(\\) expects array\\<string, mixed\\>, mixed given\\.$#"
count: 1
path: ../../../src/updater/UpdateCheckTask.php
-
message: "#^Parameter \\#3 \\$length of function substr expects int, mixed given\\.$#"
count: 1
path: ../../../src/utils/Internet.php
-
message: "#^Parameter \\#2 \\$start of function substr expects int, mixed given\\.$#"
count: 1
path: ../../../src/utils/Internet.php
-
message: "#^Parameter \\#1 \\$errorType of static method pocketmine\\\\errorhandler\\\\ErrorTypeToStringMap\\:\\:get\\(\\) expects int, mixed given\\.$#"
count: 1
path: ../../../src/utils/MainLogger.php
-
message: "#^Part \\$errno \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: ../../../src/utils/MainLogger.php
-
message: "#^Parameter \\#2 \\$str of function fwrite expects string, mixed given\\.$#"
count: 1
path: ../../../src/utils/MainLogger.php
-
message: "#^Cannot access offset 'status' on mixed\\.$#"
count: 1
path: ../../../src/utils/Timezone.php
-
message: "#^Cannot access offset 'timezone' on mixed\\.$#"
count: 2
path: ../../../src/utils/Timezone.php
-
message: "#^Parameter \\#2 \\$input1 of function array_map expects array, mixed given\\.$#"
count: 1
path: ../../../src/utils/Utils.php
-
message: "#^Parameter \\#1 \\$path of static method pocketmine\\\\utils\\\\Filesystem\\:\\:cleanPath\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/utils/Utils.php
-
message: "#^Cannot cast mixed to int\\.$#"
count: 4
path: ../../../src/world/World.php
-
message: "#^Parameter \\#1 \\$keys of function array_fill_keys expects array, mixed given\\.$#"
count: 1
path: ../../../src/world/World.php
-
message: "#^Parameter \\#2 \\$value of method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:setString\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/world/format/io/data/BedrockWorldData.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: ../../../src/world/format/io/data/BedrockWorldData.php
-
message: "#^Parameter \\#2 \\$value of method pocketmine\\\\nbt\\\\tag\\\\CompoundTag\\:\\:setString\\(\\) expects string, mixed given\\.$#"
count: 1
path: ../../../src/world/format/io/data/JavaWorldData.php
-
message: "#^Cannot cast mixed to string\\.$#"
count: 1
path: ../../../src/world/format/io/data/JavaWorldData.php
-
message: "#^Cannot access offset 1 on mixed\\.$#"
count: 2
path: ../../../src/world/format/io/region/RegionWorldProvider.php
-
message: "#^Cannot access offset 2 on mixed\\.$#"
count: 2
path: ../../../src/world/format/io/region/RegionWorldProvider.php
-
message: "#^Property pocketmine\\\\world\\\\generator\\\\Flat\\:\\:\\$preset \\(string\\) does not accept mixed\\.$#"
count: 1
path: ../../../src/world/generator/Flat.php
-
message: "#^Parameter \\#4 \\$q0 of static method pocketmine\\\\world\\\\generator\\\\noise\\\\Noise\\:\\:linearLerp\\(\\) expects float, mixed given\\.$#"
count: 1
path: ../../../src/world/generator/noise/Noise.php
-
message: "#^Parameter \\#5 \\$q1 of static method pocketmine\\\\world\\\\generator\\\\noise\\\\Noise\\:\\:linearLerp\\(\\) expects float, mixed given\\.$#"
count: 1
path: ../../../src/world/generator/noise/Noise.php
-
message: "#^Cannot access offset int on mixed\\.$#"
count: 6
path: ../../../src/world/generator/noise/Noise.php
-
message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#"
count: 1
path: ../../phpunit/block/BlockTest.php
-
message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#"
count: 1
path: ../../phpunit/block/BlockTest.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: ../../phpunit/block/BlockTest.php
-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: ../../phpunit/block/regenerate_consistency_check.php
-
message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#"
count: 3
path: ../../phpunit/block/regenerate_consistency_check.php