From 817fec9e3d4b01be17356d4478db0719b8ef12cd Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 00:44:52 +0100 Subject: [PATCH 1/8] EducationSettingsPacket: safeguard against purity issue reported by PHPStan while annoying, PHPStan is right to complain about this, because putBool() is impure, meaning that these fields could have been mutated in the call. We know they didn't, but PHPStan doesn't, and we can't mark the method as pure because .. well .. it isn't. --- .../network/mcpe/protocol/EducationSettingsPacket.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/network/mcpe/protocol/EducationSettingsPacket.php b/src/pocketmine/network/mcpe/protocol/EducationSettingsPacket.php index a53f687ed..cb8f35d53 100644 --- a/src/pocketmine/network/mcpe/protocol/EducationSettingsPacket.php +++ b/src/pocketmine/network/mcpe/protocol/EducationSettingsPacket.php @@ -133,9 +133,10 @@ class EducationSettingsPacket extends DataPacket{ $this->putBool($this->disableLegacyTitleBar); $this->putString($this->postProcessFilter); $this->putString($this->screenshotBorderResourcePath); - if($this->agentCapabilities !== null){ + $agentCapabilities = $this->agentCapabilities; + if($agentCapabilities !== null){ $this->putBool(true); - $this->agentCapabilities->write($this); + $agentCapabilities->write($this); }else{ $this->putBool(false); } @@ -144,9 +145,10 @@ class EducationSettingsPacket extends DataPacket{ $this->putString($this->codeBuilderOverrideUri); } $this->putBool($this->hasQuiz); - if($this->linkSettings !== null){ + $linkSettings = $this->linkSettings; + if($linkSettings !== null){ $this->putBool(true); - $this->linkSettings->write($this); + $linkSettings->write($this); }else{ $this->putBool(false); } From b3601c93900e1d579b32897d67ae9e93773b2b5c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 00:45:07 +0100 Subject: [PATCH 2/8] Regenerate PHPStan baselines --- .../check-explicit-mixed-baseline.neon | 22 +++++++++---------- tests/phpstan/configs/l7-baseline.neon | 7 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tests/phpstan/configs/check-explicit-mixed-baseline.neon b/tests/phpstan/configs/check-explicit-mixed-baseline.neon index 7c9cc5451..9c7492962 100644 --- a/tests/phpstan/configs/check-explicit-mixed-baseline.neon +++ b/tests/phpstan/configs/check-explicit-mixed-baseline.neon @@ -42,7 +42,7 @@ parameters: - message: "#^Parameter \\#1 \\$string of function base64_decode expects string, mixed given\\.$#" - count: 5 + count: 6 path: ../../../src/pocketmine/Player.php - @@ -51,27 +51,32 @@ parameters: path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#10 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" + message: "#^Parameter \\#10 \\$capeId of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#11 \\$personaCapeOnClassic of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" + message: "#^Parameter \\#12 \\$armSize of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#12 \\$capeId of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" + message: "#^Parameter \\#13 \\$skinColor of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#14 \\$armSize of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" + message: "#^Parameter \\#17 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#15 \\$skinColor of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, mixed given\\.$#" + message: "#^Parameter \\#18 \\$persona of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" + count: 1 + path: ../../../src/pocketmine/Player.php + + - + message: "#^Parameter \\#19 \\$personaCapeOnClassic of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php @@ -85,11 +90,6 @@ parameters: count: 2 path: ../../../src/pocketmine/Player.php - - - message: "#^Parameter \\#9 \\$premium of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects bool, mixed given\\.$#" - count: 1 - path: ../../../src/pocketmine/Player.php - - message: "#^Cannot access offset 'git' on mixed\\.$#" count: 2 diff --git a/tests/phpstan/configs/l7-baseline.neon b/tests/phpstan/configs/l7-baseline.neon index 8da59e251..0f6f063c1 100644 --- a/tests/phpstan/configs/l7-baseline.neon +++ b/tests/phpstan/configs/l7-baseline.neon @@ -41,7 +41,12 @@ parameters: path: ../../../src/pocketmine/Player.php - - message: "#^Parameter \\#8 \\$animationData of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#" + message: "#^Parameter \\#8 \\$geometryDataEngineVersion of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../../../src/pocketmine/Player.php + + - + message: "#^Parameter \\#9 \\$animationData of class pocketmine\\\\network\\\\mcpe\\\\protocol\\\\types\\\\SkinData constructor expects string, string\\|false given\\.$#" count: 1 path: ../../../src/pocketmine/Player.php From 352162a6e6ac7b4641d2fc200ed3ba5908292eda Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 00:50:00 +0100 Subject: [PATCH 3/8] Fixed PHP 7.4 build --- tests/phpstan/configs/php7.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpstan/configs/php7.neon b/tests/phpstan/configs/php7.neon index e98ee2176..f02766677 100644 --- a/tests/phpstan/configs/php7.neon +++ b/tests/phpstan/configs/php7.neon @@ -12,7 +12,7 @@ parameters: - message: "#^Parameter \\#1 \\$str of function base64_decode expects string, mixed given\\.$#" - count: 5 + count: 6 path: ../../../src/pocketmine/Player.php - From 43ac3fbf3e47ecda48c3d95aff2068a4ceec8c08 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 00:51:06 +0100 Subject: [PATCH 4/8] actions: use newer PHP versions --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0c2f95b9b..74d55641a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: image: [ubuntu-20.04] - php: [7.4.22, 8.0.9] + php: [7.4.23, 8.0.10] steps: - uses: actions/checkout@v2 #needed for build.sh @@ -37,10 +37,10 @@ jobs: fail-fast: false matrix: include: - - php: 8.0.9 + - php: 8.0.10 config: phpstan.neon.dist image: ubuntu-20.04 - - php: 7.4.22 + - php: 7.4.23 config: phpstan.php7.neon image: ubuntu-20.04 @@ -92,7 +92,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.22, 8.0.9] + php: [7.4.23, 8.0.10] steps: - uses: actions/checkout@v2 @@ -142,7 +142,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.22, 8.0.9] + php: [7.4.23, 8.0.10] steps: - uses: actions/checkout@v2 @@ -194,7 +194,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.22, 8.0.9] + php: [7.4.23, 8.0.10] steps: - uses: actions/checkout@v2 From 14fba366364eca9f13a30b955c702edbd8e66267 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 01:00:50 +0100 Subject: [PATCH 5/8] Release 3.23.1 --- changelogs/3.23.md | 3 +++ src/pocketmine/VersionInfo.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/changelogs/3.23.md b/changelogs/3.23.md index 216ac2f95..91a871ef5 100644 --- a/changelogs/3.23.md +++ b/changelogs/3.23.md @@ -9,3 +9,6 @@ Plugin developers should **only** update their required API to this version if y # 3.23.0 - Added support for Minecraft: Bedrock Edition 1.17.30. - Removed compatibility with earlier versions. + +# 3.23.1 +- Fixed broken build of 3.23.0. diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 7b8ea6fe0..975afa23d 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -34,6 +34,6 @@ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; const BASE_VERSION = "3.23.1"; -const IS_DEVELOPMENT_BUILD = true; +const IS_DEVELOPMENT_BUILD = false; const BUILD_NUMBER = 0; -const BUILD_CHANNEL = ""; +const BUILD_CHANNEL = "stable"; From d455188d036797d7bebdb29e104194a7dda8cdc9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 22 Sep 2021 01:00:50 +0100 Subject: [PATCH 6/8] 3.23.2 is next --- src/pocketmine/VersionInfo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/VersionInfo.php b/src/pocketmine/VersionInfo.php index 975afa23d..ce905e803 100644 --- a/src/pocketmine/VersionInfo.php +++ b/src/pocketmine/VersionInfo.php @@ -33,7 +33,7 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){ const _VERSION_INFO_INCLUDED = true; const NAME = "PocketMine-MP"; -const BASE_VERSION = "3.23.1"; -const IS_DEVELOPMENT_BUILD = false; +const BASE_VERSION = "3.23.2"; +const IS_DEVELOPMENT_BUILD = true; const BUILD_NUMBER = 0; -const BUILD_CHANNEL = "stable"; +const BUILD_CHANNEL = ""; From a11cf8c2965f9ef712687ef6b74c32fc6d610709 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 28 Sep 2021 20:52:40 +0100 Subject: [PATCH 7/8] Update PHP versions used by GitHub Actions --- .github/workflows/main.yml | 12 ++++++------ tests/gh-actions/build.sh | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74d55641a..ae5ecd62f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: image: [ubuntu-20.04] - php: [7.4.23, 8.0.10] + php: [7.4.24, 8.0.11] steps: - uses: actions/checkout@v2 #needed for build.sh @@ -37,10 +37,10 @@ jobs: fail-fast: false matrix: include: - - php: 8.0.10 + - php: 8.0.11 config: phpstan.neon.dist image: ubuntu-20.04 - - php: 7.4.23 + - php: 7.4.24 config: phpstan.php7.neon image: ubuntu-20.04 @@ -92,7 +92,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.23, 8.0.10] + php: [7.4.24, 8.0.11] steps: - uses: actions/checkout@v2 @@ -142,7 +142,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.23, 8.0.10] + php: [7.4.24, 8.0.11] steps: - uses: actions/checkout@v2 @@ -194,7 +194,7 @@ jobs: fail-fast: false matrix: image: [ubuntu-20.04] - php: [7.4.23, 8.0.10] + php: [7.4.24, 8.0.11] steps: - uses: actions/checkout@v2 diff --git a/tests/gh-actions/build.sh b/tests/gh-actions/build.sh index a8703e8d2..4dd13b8fe 100755 --- a/tests/gh-actions/build.sh +++ b/tests/gh-actions/build.sh @@ -17,7 +17,7 @@ INSTALL_DIR="$(pwd)/bin/php7" export CFLAGS="$CFLAGS -march=x86-64" export CXXFLAGS="$CXXFLAGS -march=x86-64" -git clone https://github.com/php-build/php-build.git +git clone https://github.com/pmmp/php-build.git cd php-build ./install-dependencies.sh echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition From 65e468e3c23908455533e4a7da3b2a5a7a622a59 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 28 Sep 2021 21:00:13 +0100 Subject: [PATCH 8/8] Updated build/php submodule to pmmp/php-build-scripts@6aac46e5008a6e3701c537d7e9d0669079523fc6 --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index e55c60f17..6aac46e50 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit e55c60f1760a019662e0fa139210975e8a160d31 +Subproject commit 6aac46e5008a6e3701c537d7e9d0669079523fc6