From 8b5e4c1c168b8a65c0a6fec72dd7c85320cba518 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 15 Dec 2022 20:16:56 +0000 Subject: [PATCH 1/8] Updated PHPStan --- composer.json | 2 +- composer.lock | 40 ++++++++++++------------- tests/phpstan/configs/phpstan-bugs.neon | 12 +------- 3 files changed, 22 insertions(+), 32 deletions(-) diff --git a/composer.json b/composer.json index 3b31d00c7..b12a81ccc 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.2", + "phpstan/phpstan": "1.9.3", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index faeee4ffc..c297f24ac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6818c4f3d55e45758df83a56d60653cf", + "content-hash": "fc2815c1e0f1865c68b54cf2e92b8434", "packages": [ { "name": "adhocore/json-comment", @@ -1820,16 +1820,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "709999b91448d4f2bb07daffffedc889b33e461c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", + "reference": "709999b91448d4f2bb07daffffedc889b33e461c", "shasum": "" }, "require": { @@ -1859,7 +1859,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "source": "https://github.com/phpstan/phpstan/tree/1.9.3" }, "funding": [ { @@ -1875,25 +1875,25 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2022-12-13T10:28:10+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "1.3.0", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "4c06b7e3f2c40081334d86975350dda814bd064a" + "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4c06b7e3f2c40081334d86975350dda814bd064a", - "reference": "4c06b7e3f2c40081334d86975350dda814bd064a", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", + "reference": "cd9c6938f8bbfcb6da3ed5a3c7ea60873825d088", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.0" + "phpstan/phpstan": "^1.9.3" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -1925,9 +1925,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.0" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.2" }, - "time": "2022-12-07T15:46:24+00:00" + "time": "2022-12-13T15:08:22+00:00" }, { "name": "phpstan/phpstan-strict-rules", @@ -1979,16 +1979,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.19", + "version": "9.2.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", "shasum": "" }, "require": { @@ -2044,7 +2044,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" }, "funding": [ { @@ -2052,7 +2052,7 @@ "type": "github" } ], - "time": "2022-11-18T07:47:47+00:00" + "time": "2022-12-14T13:26:54+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index c84371b11..3ee56e8be 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -15,11 +15,6 @@ parameters: count: 1 path: ../../../src/entity/projectile/Projectile.php - - - message: "#^Empty array passed to foreach\\.$#" - count: 1 - path: ../../../src/network/mcpe/cache/ChunkCache.php - - message: "#^Match arm comparison between 4 and 4 is always true\\.$#" count: 1 @@ -51,7 +46,7 @@ parameters: path: ../../../src/plugin/PluginManager.php - - message: "#^Offset \\(int\\|string\\) on non\\-empty\\-array\\ in isset\\(\\) always exists and is not nullable\\.$#" + message: "#^Offset \\(int\\|string\\) on array\\ in isset\\(\\) always exists and is not nullable\\.$#" count: 1 path: ../../../src/plugin/PluginManager.php @@ -70,11 +65,6 @@ parameters: count: 1 path: ../../../src/thread/Worker.php - - - message: "#^Offset \\(int\\|string\\) on non\\-empty\\-array\\ in isset\\(\\) always exists and is not nullable\\.$#" - count: 1 - path: ../../../src/world/WorldManager.php - - message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#" count: 2 From 97d6a79b25521c47216f44543e0fde001230fbaf Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 15 Dec 2022 20:37:36 +0000 Subject: [PATCH 2/8] Updated BedrockProtocol --- composer.json | 2 +- composer.lock | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index b12a81ccc..dbf2aefed 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "fgrosse/phpasn1": "^2.3", "netresearch/jsonmapper": "^4.0", "pocketmine/bedrock-data": "~1.13.0+bedrock-1.19.50", - "pocketmine/bedrock-protocol": "~17.0.0+bedrock-1.19.50", + "pocketmine/bedrock-protocol": "~17.1.0+bedrock-1.19.50", "pocketmine/binaryutils": "^0.2.1", "pocketmine/callback-validator": "^1.0.2", "pocketmine/classloader": "^0.2.0", diff --git a/composer.lock b/composer.lock index c297f24ac..3fa95a2a6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fc2815c1e0f1865c68b54cf2e92b8434", + "content-hash": "4c222172c7114c112009b3513c017df5", "packages": [ { "name": "adhocore/json-comment", @@ -275,16 +275,16 @@ }, { "name": "pocketmine/bedrock-protocol", - "version": "17.0.0+bedrock-1.19.50", + "version": "17.1.0+bedrock-1.19.50", "source": { "type": "git", "url": "https://github.com/pmmp/BedrockProtocol.git", - "reference": "272e10197bb1603c0a81075bf5b9dae0d081a6e2" + "reference": "c572706cf5e3202718dd35a35dd30fe08cd671de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/272e10197bb1603c0a81075bf5b9dae0d081a6e2", - "reference": "272e10197bb1603c0a81075bf5b9dae0d081a6e2", + "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/c572706cf5e3202718dd35a35dd30fe08cd671de", + "reference": "c572706cf5e3202718dd35a35dd30fe08cd671de", "shasum": "" }, "require": { @@ -298,7 +298,7 @@ "ramsey/uuid": "^4.1" }, "require-dev": { - "phpstan/phpstan": "1.9.0", + "phpstan/phpstan": "1.9.3", "phpstan/phpstan-phpunit": "^1.0.0", "phpstan/phpstan-strict-rules": "^1.0.0", "phpunit/phpunit": "^9.5" @@ -316,9 +316,9 @@ "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", "support": { "issues": "https://github.com/pmmp/BedrockProtocol/issues", - "source": "https://github.com/pmmp/BedrockProtocol/tree/17.0.0+bedrock-1.19.50" + "source": "https://github.com/pmmp/BedrockProtocol/tree/17.1.0+bedrock-1.19.50" }, - "time": "2022-11-30T16:16:27+00:00" + "time": "2022-12-15T20:34:49+00:00" }, { "name": "pocketmine/binaryutils", From 0ee6cdb058d4bd2e058352b3a710177366019c03 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 15 Dec 2022 21:08:23 +0000 Subject: [PATCH 3/8] Release 4.12.2 --- changelogs/4.12.md | 12 ++++++++++++ src/VersionInfo.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/changelogs/4.12.md b/changelogs/4.12.md index efd53e528..eaf4c8d25 100644 --- a/changelogs/4.12.md +++ b/changelogs/4.12.md @@ -18,3 +18,15 @@ Released 4th December 2022. ## Fixes - Fixed items glitching when dragging a stack of items across the crafting grid (desync issues). + +# 4.12.2 +Released 15th December 2022. + +## Fixes +- Folder used for plugins (optionally specified by `--plugins`) is no longer required to be writable. +- Fixed broken writable check for server data folder (`is_writable()` broken on NFS and similar filesystems). +- `Filesystem::createLockFile()` exceptions now include more information about why the lock file could not be created. +- Fixed client-side item predictions not being rolled back when cancelling events such as `PlayerItemUseEvent`. + +## Dependencies +- Updated BedrockProtocol to [17.1.0](https://github.com/pmmp/BedrockProtocol/releases/tag/17.1.0+bedrock-1.19.50). This adds some missing `LevelSoundEvent` constants and fixes the values for `ContainerUIIds`. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 3519fd039..edb2c14af 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -32,7 +32,7 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; public const BASE_VERSION = "4.12.2"; - public const IS_DEVELOPMENT_BUILD = true; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 437fa615b8f9710cf0662517f1b15f072a681708 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 15 Dec 2022 21:08:28 +0000 Subject: [PATCH 4/8] 4.12.3 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index edb2c14af..54fde8a37 100644 --- a/src/VersionInfo.php +++ b/src/VersionInfo.php @@ -31,8 +31,8 @@ use function str_repeat; final class VersionInfo{ public const NAME = "PocketMine-MP"; - public const BASE_VERSION = "4.12.2"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "4.12.3"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; private function __construct(){ From 529700bb8b8cc42ee2f8bc8d838ef08ab974b4b2 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 19 Dec 2022 15:33:15 +0000 Subject: [PATCH 5/8] PotionTypeIdMap: fixed uninitialized fields I have no idea why this didn't ever cause a problem before... probably an edge-case in the typed properties implementation --- src/data/bedrock/PotionTypeIdMap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/bedrock/PotionTypeIdMap.php b/src/data/bedrock/PotionTypeIdMap.php index eebab87e2..2e6fef3cc 100644 --- a/src/data/bedrock/PotionTypeIdMap.php +++ b/src/data/bedrock/PotionTypeIdMap.php @@ -33,13 +33,13 @@ final class PotionTypeIdMap{ * @var PotionType[] * @phpstan-var array */ - private array $idToEnum; + private array $idToEnum = []; /** * @var int[] * @phpstan-var array */ - private array $enumToId; + private array $enumToId = []; private function __construct(){ $this->register(PotionTypeIds::WATER, PotionType::WATER()); From 65bce762ff187316693d06ea33183e7e864a6e4f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 19 Dec 2022 15:34:17 +0000 Subject: [PATCH 6/8] Updated transient Composer dependencies --- composer.lock | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 3fa95a2a6..d1e798347 100644 --- a/composer.lock +++ b/composer.lock @@ -123,24 +123,24 @@ }, { "name": "fgrosse/phpasn1", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/fgrosse/PHPASN1.git", - "reference": "eef488991d53e58e60c9554b09b1201ca5ba9296" + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/eef488991d53e58e60c9554b09b1201ca5ba9296", - "reference": "eef488991d53e58e60c9554b09b1201ca5ba9296", + "url": "https://api.github.com/repos/fgrosse/PHPASN1/zipball/42060ed45344789fb9f21f9f1864fc47b9e3507b", + "reference": "42060ed45344789fb9f21f9f1864fc47b9e3507b", "shasum": "" }, "require": { - "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "php-coveralls/php-coveralls": "~2.0", - "phpunit/phpunit": "^6.3 || ^7.0 || ^8.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-bcmath": "BCmath is the fallback extension for big integer calculations", @@ -192,9 +192,10 @@ ], "support": { "issues": "https://github.com/fgrosse/PHPASN1/issues", - "source": "https://github.com/fgrosse/PHPASN1/tree/v2.4.0" + "source": "https://github.com/fgrosse/PHPASN1/tree/v2.5.0" }, - "time": "2021-12-11T12:41:06+00:00" + "abandoned": true, + "time": "2022-12-19T11:08:26+00:00" }, { "name": "netresearch/jsonmapper", @@ -1979,16 +1980,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -2044,7 +2045,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -2052,7 +2053,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", From 63e8b1cf3a1701da3198303f01d3a34520e1fcf6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:39:59 +0000 Subject: [PATCH 7/8] Bump phpstan/phpstan from 1.9.3 to 1.9.4 (#5458) Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.9.3 to 1.9.4. - [Release notes](https://github.com/phpstan/phpstan/releases) - [Changelog](https://github.com/phpstan/phpstan/blob/1.9.x/CHANGELOG.md) - [Commits](https://github.com/phpstan/phpstan/compare/1.9.3...1.9.4) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index dbf2aefed..90c838f18 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "webmozart/path-util": "^2.3" }, "require-dev": { - "phpstan/phpstan": "1.9.3", + "phpstan/phpstan": "1.9.4", "phpstan/phpstan-phpunit": "^1.1.0", "phpstan/phpstan-strict-rules": "^1.2.0", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index d1e798347..b9626d576 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4c222172c7114c112009b3513c017df5", + "content-hash": "393c7921d03d080d3ef3b836f90b4415", "packages": [ { "name": "adhocore/json-comment", @@ -1821,16 +1821,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c" + "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d03bccee595e2146b7c9d174486b84f4dc61b0f2", + "reference": "d03bccee595e2146b7c9d174486b84f4dc61b0f2", "shasum": "" }, "require": { @@ -1860,7 +1860,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.3" + "source": "https://github.com/phpstan/phpstan/tree/1.9.4" }, "funding": [ { @@ -1876,7 +1876,7 @@ "type": "tidelift" } ], - "time": "2022-12-13T10:28:10+00:00" + "time": "2022-12-17T13:33:52+00:00" }, { "name": "phpstan/phpstan-phpunit", From 7a137f932f643478a81b9a9ddea0188fc395a9ca Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 19 Dec 2022 15:52:44 +0000 Subject: [PATCH 8/8] Updated build/php submodule to pmmp/php-build-scripts@6b605ed7c458fc8f95080ffe41a7f248a7160107 --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index 27cc1fcdf..6b605ed7c 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit 27cc1fcdfa54b11c83d5d9056d189d080e5a7786 +Subproject commit 6b605ed7c458fc8f95080ffe41a7f248a7160107