From ab05bc7379bc295e6c5b2a67aceba7d040646eef Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Aug 2021 14:23:11 +0100 Subject: [PATCH 1/3] Replace some references to Pocket Edition with Bedrock Edition closes #4387 --- composer.json | 2 +- start.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6b1f9812b..456639092 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "pocketmine/pocketmine-mp", - "description": "A server software for Minecraft: Pocket Edition written in PHP", + "description": "A server software for Minecraft: Bedrock Edition written in PHP", "type": "project", "homepage": "https://pmmp.io", "license": "LGPL-3.0", diff --git a/start.cmd b/start.cmd index 4e4c3a93e..929e5f7bb 100644 --- a/start.cmd +++ b/start.cmd @@ -1,5 +1,5 @@ @echo off -TITLE PocketMine-MP server software for Minecraft: Pocket Edition +TITLE PocketMine-MP server software for Minecraft: Bedrock Edition cd /d %~dp0 if exist bin\php\php.exe ( From 63e86fe806771b410380fee2b8c9254f4e9bcc71 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Aug 2021 14:44:59 +0100 Subject: [PATCH 2/3] Config: fixed incorrect fluent @return annotations --- src/pocketmine/utils/Config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/utils/Config.php b/src/pocketmine/utils/Config.php index edcb635ae..cdeafbb9f 100644 --- a/src/pocketmine/utils/Config.php +++ b/src/pocketmine/utils/Config.php @@ -258,7 +258,7 @@ class Config{ /** * Sets the options for the JSON encoding when saving * - * @return Config $this + * @return $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode */ @@ -275,7 +275,7 @@ class Config{ /** * Enables the given option in addition to the currently set JSON options * - * @return Config $this + * @return $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode */ @@ -292,7 +292,7 @@ class Config{ /** * Disables the given option for the JSON encoding when saving * - * @return Config $this + * @return $this * @throws \RuntimeException if the Config is not in JSON * @see json_encode */ From ff4aa148ef267175f833172e44869b6ff00fce23 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Aug 2021 22:45:38 +0100 Subject: [PATCH 3/3] phpstan 0.12.95 --- composer.json | 2 +- composer.lock | 14 ++-- phpstan.neon.dist | 1 + tests/phpstan/configs/phpstan-bugs.neon | 15 ++-- .../configs/spl-fixed-array-sucks.neon | 72 +++++++++++++++++++ 5 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 tests/phpstan/configs/spl-fixed-array-sucks.neon diff --git a/composer.json b/composer.json index 456639092..01cbd4938 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "pocketmine/spl": "^0.4.0" }, "require-dev": { - "phpstan/phpstan": "0.12.92", + "phpstan/phpstan": "0.12.95", "phpstan/phpstan-phpunit": "^0.12.6", "phpstan/phpstan-strict-rules": "^0.12.2", "phpunit/phpunit": "^9.2" diff --git a/composer.lock b/composer.lock index e9c832b50..37a159fc4 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": "79b082334bd3930d7eef49be9b70e59f", + "content-hash": "bcb98fdf7f5d5f441caca14fbb87c4de", "packages": [ { "name": "adhocore/json-comment", @@ -1009,16 +1009,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.92", + "version": "0.12.95", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "64d4c5dc8ea96972bc18432d137a330239a5d2b2" + "reference": "4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/64d4c5dc8ea96972bc18432d137a330239a5d2b2", - "reference": "64d4c5dc8ea96972bc18432d137a330239a5d2b2", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58", + "reference": "4ffddfe86e85dcc494a47e5f3dcfd1a2dccdce58", "shasum": "" }, "require": { @@ -1049,7 +1049,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.92" + "source": "https://github.com/phpstan/phpstan/tree/0.12.95" }, "funding": [ { @@ -1069,7 +1069,7 @@ "type": "tidelift" } ], - "time": "2021-07-10T13:53:49+00:00" + "time": "2021-08-20T12:53:41+00:00" }, { "name": "phpstan/phpstan-phpunit", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 1ea3bc16a..88d9918ac 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -10,6 +10,7 @@ includes: - tests/phpstan/configs/phpunit-wiring-tests.neon - tests/phpstan/configs/pthreads-bugs.neon - tests/phpstan/configs/runtime-type-checks.neon + - tests/phpstan/configs/spl-fixed-array-sucks.neon - vendor/phpstan/phpstan-phpunit/extension.neon - vendor/phpstan/phpstan-phpunit/rules.neon - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 2fc5c83fe..c98712cb1 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -15,16 +15,16 @@ parameters: count: 2 path: ../../../src/pocketmine/level/format/io/region/RegionLoader.php + - + message: "#^Parameter \\#2 \\$count of function array_fill expects int\\<0, max\\>, int given\\.$#" + count: 2 + path: ../../../src/pocketmine/level/generator/noise/Noise.php + - message: "#^Call to function method_exists\\(\\) with pocketmine\\\\network\\\\mcpe\\\\CachedEncapsulatedPacket and '__toString' will always evaluate to true\\.$#" count: 1 path: ../../../src/pocketmine/network/mcpe/protocol/DataPacket.php - - - message: "#^Parameter \\#1 \\$read of function socket_select expects array\\\\|null, array\\ given\\.$#" - count: 1 - path: ../../../src/pocketmine/network/rcon/RCONInstance.php - - message: "#^Parameter \\#1 \\$ of closure expects TMemberType, TMemberType given\\.$#" count: 1 @@ -35,8 +35,3 @@ parameters: count: 1 path: ../../../src/pocketmine/utils/Utils.php - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotNull\\(\\) with int and string will always evaluate to true\\.$#" - count: 1 - path: ../../phpunit/block/BlockTest.php - diff --git a/tests/phpstan/configs/spl-fixed-array-sucks.neon b/tests/phpstan/configs/spl-fixed-array-sucks.neon new file mode 100644 index 000000000..39da88bdc --- /dev/null +++ b/tests/phpstan/configs/spl-fixed-array-sucks.neon @@ -0,0 +1,72 @@ +parameters: + ignoreErrors: + - + message: "#^Cannot call method getBlockData\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/Level.php + + - + message: "#^Cannot call method getBlockId\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/Level.php + + - + message: "#^Cannot call method getBlockDataArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockDataColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockIdArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockIdColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockLightArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockLightColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockSkyLightArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockSkyLightColumn\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Method pocketmine\\\\level\\\\format\\\\Chunk\\:\\:getHeightMapArray\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/Chunk.php + + - + message: "#^Cannot call method getBlockDataArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php + + - + message: "#^Cannot call method getBlockIdArray\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php + + - + message: "#^Cannot call method isEmpty\\(\\) on pocketmine\\\\level\\\\format\\\\SubChunkInterface\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/level/format/io/leveldb/LevelDB.php +