From 2de0ec02ba7392dc3398467dcd21d2d432fc5ca7 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 28 Dec 2019 17:22:08 +0000 Subject: [PATCH 1/4] phpstan 0.12.3 --- tests/phpstan/configs/phpstan-bugs.neon | 22 ---------------------- tests/travis.sh | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index f795f9778..8907818ba 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -48,29 +48,7 @@ parameters: count: 1 path: ../../../src/pocketmine/entity/projectile/Projectile.php - - - message: "#^Strict comparison using \\=\\=\\= between int\\ 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 - - message: "#^Strict comparison using \\=\\=\\= between int\\<1, max\\> and 0 will always evaluate to false\\.$#" count: 1 path: ../../../src/pocketmine/utils/Config.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 diff --git a/tests/travis.sh b/tests/travis.sh index ee5053262..6c787b451 100755 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then exit 1 fi -[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.2/phpstan.phar +[ ! -f phpstan.phar ] && echo "Downloading PHPStan..." && curl -sSLO https://github.com/phpstan/phpstan/releases/download/0.12.3/phpstan.phar "$PHP_BINARY" phpstan.phar analyze --no-progress --memory-limit=2G || exit 1 echo "PHPStan scan succeeded" From a37d7401112fe6cbafcb5aa58b13d382fb9aeee4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 29 Dec 2019 13:11:30 +0000 Subject: [PATCH 2/4] Release 3.11.2 --- changelogs/3.11.md | 23 ++++++++++++++++++++++- src/pocketmine/VersionInfo.php | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/changelogs/3.11.md b/changelogs/3.11.md index 31bf75d07..b6e52f0b8 100644 --- a/changelogs/3.11.md +++ b/changelogs/3.11.md @@ -11,4 +11,25 @@ Plugin developers should **only** update their required API to this version if y - Removed compatibility with 1.13.0 # 3.11.1 -- Fixed blocks with incorrect properties when placed or interacted with. \ No newline at end of file +- Fixed blocks with incorrect properties when placed or interacted with. + +# 3.11.2 +## Core +- PHPStan 0.12.3 with level 5 is now used for automated static analysis. +- Fixed a possible crash when plugins override the `EnderChest` tile class with something incompatible. +- Fixed disconnected players being considered as never played. +- Fixed enchantments with IDs outside the range 0-255 in item NBT crashing the server. +- Fixed particles rendering incorrectly. +- Timings handlers are no longer able to underflow; they now throw exceptions when attempting to be stopped more times than they were started. +- Fixed explosion rays getting stuck in empty subchunks (possible incorrect behaviour in large caves). +- Fixed bad tile/entity NBT data being propagated from world providers in some cases. +- Fixed a possible crash when detecting timezone on CentOS. +- Fixed many cases of incorrectly documented types in the API found by PHPStan. +- Generation tasks no longer assume that generator instances stored in TLS are always valid, fixing a possible crash. + +## Protocol +- Fixed skin animation image corruption in LoginPacket handling caused by incorrect data handling. +- Fixed skin animation extra data not being decoded from LoginPacket. +- `SkinImage` now throws `InvalidArgumentException` if it receives an unexpected amount of bytes for the given image heigh/width. +- Fixed broken code in `PlayerAuthInputPacket::create()`. +- Removed some dead constants from `NetworkInventoryAction`. diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index a8e900838..776892a24 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -31,5 +31,5 @@ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; const BASE_VERSION = "3.11.2"; -const IS_DEVELOPMENT_BUILD = true; +const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; From dadc5c1b87d4603cd2ee89227d9ff4e4e84abb20 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 29 Dec 2019 13:11:30 +0000 Subject: [PATCH 3/4] 3.11.3 is next --- src/pocketmine/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 776892a24..4b677cc2c 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -30,6 +30,6 @@ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.11.2"; -const IS_DEVELOPMENT_BUILD = false; +const BASE_VERSION = "3.11.3"; +const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; From 3e23a568caadfa93b920fe3926e0bbae79e55e1b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 29 Dec 2019 14:25:44 +0000 Subject: [PATCH 4/4] phpstan: properly fixing FPs on constant comparisons --- phpstan.neon.dist | 4 +++- tests/phpstan/configs/debug-const-checks.neon | 21 ------------------- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 tests/phpstan/configs/debug-const-checks.neon diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3880ad102..3588a1117 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,4 @@ includes: - - tests/phpstan/configs/debug-const-checks.neon - tests/phpstan/configs/gc-hacks.neon - tests/phpstan/configs/optional-com-dotnet.neon - tests/phpstan/configs/optional-leveldb.neon @@ -14,6 +13,9 @@ parameters: - src/pocketmine/PocketMine.php paths: - src + dynamicConstantNames: + - pocketmine\IS_DEVELOPMENT_BUILD + - pocketmine\DEBUG reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings ignoreErrors: - diff --git a/tests/phpstan/configs/debug-const-checks.neon b/tests/phpstan/configs/debug-const-checks.neon deleted file mode 100644 index bfe2fa5c6..000000000 --- a/tests/phpstan/configs/debug-const-checks.neon +++ /dev/null @@ -1,21 +0,0 @@ -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