From 4340c26029e3523f69a188b2135bd547a0ad2e3d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 2 Jun 2023 16:37:08 +0100 Subject: [PATCH 1/9] RuntimeDataSizeCalculator: Tidy up junk comments --- src/data/runtime/RuntimeDataSizeCalculator.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/data/runtime/RuntimeDataSizeCalculator.php b/src/data/runtime/RuntimeDataSizeCalculator.php index ded209470..ce81822a0 100644 --- a/src/data/runtime/RuntimeDataSizeCalculator.php +++ b/src/data/runtime/RuntimeDataSizeCalculator.php @@ -56,12 +56,8 @@ final class RuntimeDataSizeCalculator implements RuntimeDataDescriber{ $this->addBits(2); } - /** - * @inheritDoc - */ public function horizontalFacingFlags(array &$faces) : void{ $this->addBits(count(Facing::HORIZONTAL)); - // TODO: Implement horizontalFacingFlags() method. } public function facing(int &$facing) : void{ From 4e031e7b3e3b5393a21c7b54d1b0ff3a9c60cca9 Mon Sep 17 00:00:00 2001 From: IvanCraft623 <57236932+IvanCraft623@users.noreply.github.com> Date: Sat, 3 Jun 2023 10:07:44 -0500 Subject: [PATCH 2/9] Always drop spore blossom item when it is broken (#5796) --- src/block/SporeBlossom.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/block/SporeBlossom.php b/src/block/SporeBlossom.php index 83f9723c8..73e31edf2 100644 --- a/src/block/SporeBlossom.php +++ b/src/block/SporeBlossom.php @@ -49,8 +49,4 @@ final class SporeBlossom extends Flowable{ $this->position->getWorld()->useBreakOn($this->position); } } - - public function getDropsForCompatibleTool(Item $item) : array{ - return []; - } } From 40be5646895a8f005d6544ee5c685fbb87d12fa6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 17:07:50 +0100 Subject: [PATCH 3/9] BlockSpreadEvent: document poorly-named constructor parameters --- src/event/block/BlockSpreadEvent.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/event/block/BlockSpreadEvent.php b/src/event/block/BlockSpreadEvent.php index 42009260d..18128bfef 100644 --- a/src/event/block/BlockSpreadEvent.php +++ b/src/event/block/BlockSpreadEvent.php @@ -30,6 +30,11 @@ use pocketmine\block\Block; */ class BlockSpreadEvent extends BaseBlockChangeEvent{ + /** + * @param Block $block Block being replaced (TODO: rename this) + * @param Block $source Origin of the spread + * @param Block $newState Replacement block + */ public function __construct( Block $block, private Block $source, From c715efb18e44c11a96409fcd6e9fd6e4064f140d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 21:22:26 +0100 Subject: [PATCH 4/9] Jukebox: fix music not stopping when destroyed by explosion closes #5794 --- src/block/tile/Jukebox.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/block/tile/Jukebox.php b/src/block/tile/Jukebox.php index 3154c6a07..4d5bfdbb8 100644 --- a/src/block/tile/Jukebox.php +++ b/src/block/tile/Jukebox.php @@ -26,6 +26,7 @@ namespace pocketmine\block\tile; use pocketmine\item\Item; use pocketmine\item\Record; use pocketmine\nbt\tag\CompoundTag; +use pocketmine\world\sound\RecordStopSound; class Jukebox extends Spawnable{ private const TAG_RECORD = "RecordItem"; //Item CompoundTag @@ -61,4 +62,8 @@ class Jukebox extends Spawnable{ $nbt->setTag(self::TAG_RECORD, $this->record->nbtSerialize()); } } + + protected function onBlockDestroyedHook() : void{ + $this->position->getWorld()->addSound($this->position, new RecordStopSound()); + } } From 1706fb43eb569508488f9c167a395421a61843a6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 21:27:54 +0100 Subject: [PATCH 5/9] Updated build/php submodule to pmmp/PHP-Binaries@fcbc15f23e70d01b618cf21d090146e02254e735 --- build/php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/php b/build/php index f2ece7b30..fcbc15f23 160000 --- a/build/php +++ b/build/php @@ -1 +1 @@ -Subproject commit f2ece7b30d0364eebf1d79497003cfda1dc41aa8 +Subproject commit fcbc15f23e70d01b618cf21d090146e02254e735 From af1f7e098b59793a8d82d1f9b2a16afa3117bd48 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 21:42:43 +0100 Subject: [PATCH 6/9] Require pmmpthread 6.0.1 --- composer.json | 2 +- composer.lock | 4 ++-- src/PocketMine.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 167f208f6..415ff392f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "ext-openssl": "*", "ext-pcre": "*", "ext-phar": "*", - "ext-pmmpthread": "^6.0", + "ext-pmmpthread": "^6.0.1", "ext-reflection": "*", "ext-simplexml": "*", "ext-sockets": "*", diff --git a/composer.lock b/composer.lock index eb9dc5c01..085f9f3cf 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": "41475569123dfa40907df1071269ee5f", + "content-hash": "f48120203fe576d1ef1b7eddd8460d8f", "packages": [ { "name": "adhocore/json-comment", @@ -3020,7 +3020,7 @@ "ext-openssl": "*", "ext-pcre": "*", "ext-phar": "*", - "ext-pmmpthread": "^6.0", + "ext-pmmpthread": "^6.0.1", "ext-reflection": "*", "ext-simplexml": "*", "ext-sockets": "*", diff --git a/src/PocketMine.php b/src/PocketMine.php index 7003cca85..d5d2f7328 100644 --- a/src/PocketMine.php +++ b/src/PocketMine.php @@ -120,8 +120,8 @@ namespace pocketmine { } if(($pmmpthread_version = phpversion("pmmpthread")) !== false){ - if(version_compare($pmmpthread_version, "6.0.0-beta1") < 0 || version_compare($pmmpthread_version, "7.0.0") >= 0){ - $messages[] = "pmmpthread ^6.0.0 is required, while you have $pmmpthread_version."; + if(version_compare($pmmpthread_version, "6.0.1") < 0 || version_compare($pmmpthread_version, "7.0.0") >= 0){ + $messages[] = "pmmpthread ^6.0.1 is required, while you have $pmmpthread_version."; } } From 2f43ccea6f25014668a7a6d5686304b73b62336a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 21:56:26 +0100 Subject: [PATCH 7/9] Release 5.0.1 --- changelogs/5.0.md | 14 ++++++++++++++ src/VersionInfo.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/changelogs/5.0.md b/changelogs/5.0.md index a1d5b3292..957e4cb95 100644 --- a/changelogs/5.0.md +++ b/changelogs/5.0.md @@ -775,3 +775,17 @@ To register a new vanilla item into the core, the process is slightly different: - `NetworkSession` disconnect APIs now accept `Translatable|string` instead of `string` to allow localized disconnect messages. - `NetworkSession` disconnect methods have been altered to allow specifying a different disconnect reason and disconnection screen message. - `RuntimeBlockMapping` has been renamed to `BlockTranslator`. + +# 5.0.1 +Released 3rd June 2023. + +## Changes +- [`ext-pmmpthread` version 6.0.1](https://github.com/pmmp/ext-pmmpthread/releases/tag/6.0.1) is now required (for bug fixes). + +## Fixes +- Fixed server crash when breaking blocks placed in the same session (mishandled default block states). +- Fixed spore blossoms not dropping when broken. +- Fixed jukebox music not stopping when destroyed by an explosion. + +## Documentation +- Added documentation for `BlockSpreadEvent->__construct()` parameters. diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 6f12ff337..6482673c5 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 = "5.0.1"; - public const IS_DEVELOPMENT_BUILD = true; + public const IS_DEVELOPMENT_BUILD = false; public const BUILD_CHANNEL = "stable"; /** From 7fef8f0ab64ed0f168f87c2701f04a8f5de43e9b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 3 Jun 2023 21:56:30 +0100 Subject: [PATCH 8/9] 5.0.2 is next --- src/VersionInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VersionInfo.php b/src/VersionInfo.php index 6482673c5..3f3d6ccbc 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 = "5.0.1"; - public const IS_DEVELOPMENT_BUILD = false; + public const BASE_VERSION = "5.0.2"; + public const IS_DEVELOPMENT_BUILD = true; public const BUILD_CHANNEL = "stable"; /** From f9818efff4407fa394c65b11846df5ec8bfe125b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 4 Jun 2023 14:00:26 +0100 Subject: [PATCH 9/9] Fixed PHPUnit deprecation warnings --- tests/phpunit/block/BrewingStandTest.php | 2 +- .../command/utils/CommandStringHelperTest.php | 2 +- .../block/upgrade/BlockStateUpgraderTest.php | 36 +++++++++---------- .../phpunit/event/HandlerListManagerTest.php | 4 +-- .../item/LegacyStringToItemParserTest.php | 2 +- tests/phpunit/plugin/ApiVersionTest.php | 4 +-- .../utils/CloningRegistryTraitTest.php | 2 +- tests/phpunit/utils/ConfigTest.php | 2 +- tests/phpunit/utils/UtilsTest.php | 8 ++--- .../format/io/region/RegionLoaderTest.php | 2 +- .../region/RegionLocationTableEntryTest.php | 2 +- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/phpunit/block/BrewingStandTest.php b/tests/phpunit/block/BrewingStandTest.php index c61a1db6d..b3363b98c 100644 --- a/tests/phpunit/block/BrewingStandTest.php +++ b/tests/phpunit/block/BrewingStandTest.php @@ -33,7 +33,7 @@ class BrewingStandTest extends TestCase{ /** * @phpstan-return \Generator}, void, void> */ - public function slotsProvider() : \Generator{ + public static function slotsProvider() : \Generator{ yield [array_values(BrewingStandSlot::getAll())]; yield [[BrewingStandSlot::EAST()]]; yield [[BrewingStandSlot::EAST(), BrewingStandSlot::NORTHWEST()]]; diff --git a/tests/phpunit/command/utils/CommandStringHelperTest.php b/tests/phpunit/command/utils/CommandStringHelperTest.php index 0b8502348..047dc7ceb 100644 --- a/tests/phpunit/command/utils/CommandStringHelperTest.php +++ b/tests/phpunit/command/utils/CommandStringHelperTest.php @@ -27,7 +27,7 @@ use PHPUnit\Framework\TestCase; class CommandStringHelperTest extends TestCase{ - public function parseQuoteAwareProvider() : \Generator{ + public static function parseQuoteAwareProvider() : \Generator{ yield [ 'give "steve jobs" apple', ['give', 'steve jobs', 'apple'] diff --git a/tests/phpunit/data/bedrock/block/upgrade/BlockStateUpgraderTest.php b/tests/phpunit/data/bedrock/block/upgrade/BlockStateUpgraderTest.php index 39013d615..efd22212f 100644 --- a/tests/phpunit/data/bedrock/block/upgrade/BlockStateUpgraderTest.php +++ b/tests/phpunit/data/bedrock/block/upgrade/BlockStateUpgraderTest.php @@ -69,7 +69,7 @@ class BlockStateUpgraderTest extends TestCase{ public function testRenameId() : void{ $this->getNewSchema()->renamedIds[self::TEST_BLOCK] = self::TEST_BLOCK_2; - $getStateData = fn() => $this->getEmptyPreimage(); + $getStateData = fn() => self::getEmptyPreimage(); $upgradedStateData = $this->upgrade($getStateData(), $getStateData); self::assertSame($upgradedStateData->getName(), self::TEST_BLOCK_2); @@ -79,11 +79,11 @@ class BlockStateUpgraderTest extends TestCase{ $schema->addedProperties[self::TEST_BLOCK][self::TEST_PROPERTY] = new IntTag(self::TEST_PROPERTY_VALUE_1); } - private function getEmptyPreimage() : BlockStateData{ + private static function getEmptyPreimage() : BlockStateData{ return new BlockStateData(self::TEST_BLOCK, [], self::TEST_VERSION); } - private function getPreimageOneProperty(string $propertyName, int $value) : BlockStateData{ + private static function getPreimageOneProperty(string $propertyName, int $value) : BlockStateData{ return new BlockStateData( self::TEST_BLOCK, [$propertyName => new IntTag($value)], @@ -94,7 +94,7 @@ class BlockStateUpgraderTest extends TestCase{ public function testAddNewProperty() : void{ $this->prepareAddPropertySchema($this->getNewSchema()); - $getStateData = fn() => $this->getEmptyPreimage(); + $getStateData = fn() => self::getEmptyPreimage(); $upgradedStateData = $this->upgrade($getStateData(), $getStateData); self::assertSame(self::TEST_PROPERTY_VALUE_1, $upgradedStateData->getState(self::TEST_PROPERTY)?->getValue()); @@ -103,7 +103,7 @@ class BlockStateUpgraderTest extends TestCase{ public function testAddPropertyAlreadyExists() : void{ $this->prepareAddPropertySchema($this->getNewSchema()); - $getStateData = fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1 + 1); + $getStateData = fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1 + 1); $stateData = $getStateData(); $upgradedStateData = $this->upgrade($stateData, $getStateData); @@ -118,9 +118,9 @@ class BlockStateUpgraderTest extends TestCase{ /** * @phpstan-return \Generator */ - public function removePropertyProvider() : \Generator{ - yield [fn() => $this->getEmptyPreimage()]; - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1)]; + public static function removePropertyProvider() : \Generator{ + yield [fn() => self::getEmptyPreimage()]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1)]; } /** @@ -142,10 +142,10 @@ class BlockStateUpgraderTest extends TestCase{ /** * @phpstan-return \Generator */ - public function renamePropertyProvider() : \Generator{ - yield [fn() => $this->getEmptyPreimage(), null]; - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_1]; - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY_2, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_1]; + public static function renamePropertyProvider() : \Generator{ + yield [fn() => self::getEmptyPreimage(), null]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_1]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY_2, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_1]; } /** @@ -170,18 +170,18 @@ class BlockStateUpgraderTest extends TestCase{ /** * @phpstan-return \Generator */ - public function remapPropertyValueProvider() : \Generator{ + public static function remapPropertyValueProvider() : \Generator{ //no property to remap - yield [fn() => $this->getEmptyPreimage(), null]; + yield [fn() => self::getEmptyPreimage(), null]; //value that will be remapped - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_2]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_1), self::TEST_PROPERTY_VALUE_2]; //value that is already at the target value - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_2), self::TEST_PROPERTY_VALUE_2]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_2), self::TEST_PROPERTY_VALUE_2]; //value that is not remapped and is different from target value (to detect unconditional overwrite bugs) - yield [fn() => $this->getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_3), self::TEST_PROPERTY_VALUE_3]; + yield [fn() => self::getPreimageOneProperty(self::TEST_PROPERTY, self::TEST_PROPERTY_VALUE_3), self::TEST_PROPERTY_VALUE_3]; } /** @@ -213,7 +213,7 @@ class BlockStateUpgraderTest extends TestCase{ /** * @phpstan-return \Generator */ - public function upgraderVersionCompatibilityProvider() : \Generator{ + public static function upgraderVersionCompatibilityProvider() : \Generator{ yield [0x1_00_00_00, 0x1_00_00_00, true]; //Same version: must be altered - this may be a backwards-compatible change that Mojang didn't bother to bump for yield [0x1_00_01_00, 0x1_00_00_00, true]; //Schema newer than block: must be altered yield [0x1_00_00_00, 0x1_00_01_00, false]; //Block newer than schema: block must NOT be altered diff --git a/tests/phpunit/event/HandlerListManagerTest.php b/tests/phpunit/event/HandlerListManagerTest.php index 6d728151b..edff36639 100644 --- a/tests/phpunit/event/HandlerListManagerTest.php +++ b/tests/phpunit/event/HandlerListManagerTest.php @@ -49,7 +49,7 @@ class HandlerListManagerTest extends TestCase{ * @return \Generator|mixed[][] * @phpstan-return \Generator, bool, string}, void, void> */ - public function isValidClassProvider() : \Generator{ + public static function isValidClassProvider() : \Generator{ yield [new \ReflectionClass(Event::class), false, "event base should not be handleable"]; yield [new \ReflectionClass(TestConcreteEvent::class), true, ""]; yield [new \ReflectionClass(TestAbstractEvent::class), false, "abstract event cannot be handled"]; @@ -69,7 +69,7 @@ class HandlerListManagerTest extends TestCase{ * @return \Generator|\ReflectionClass[][] * @phpstan-return \Generator, \ReflectionClass|null}, void, void> */ - public function resolveParentClassProvider() : \Generator{ + public static function resolveParentClassProvider() : \Generator{ yield [new \ReflectionClass(TestConcreteExtendsAllowHandleEvent::class), new \ReflectionClass(TestAbstractAllowHandleEvent::class)]; yield [new \ReflectionClass(TestConcreteEvent::class), null]; yield [new \ReflectionClass(TestConcreteExtendsAbstractEvent::class), null]; diff --git a/tests/phpunit/item/LegacyStringToItemParserTest.php b/tests/phpunit/item/LegacyStringToItemParserTest.php index 04930ff81..f9243df7e 100644 --- a/tests/phpunit/item/LegacyStringToItemParserTest.php +++ b/tests/phpunit/item/LegacyStringToItemParserTest.php @@ -32,7 +32,7 @@ class LegacyStringToItemParserTest extends TestCase{ * @return mixed[][] * @phpstan-return list */ - public function itemFromStringProvider() : array{ + public static function itemFromStringProvider() : array{ return [ ["dye:4", VanillaItems::LAPIS_LAZULI()], ["351", VanillaItems::INK_SAC()], diff --git a/tests/phpunit/plugin/ApiVersionTest.php b/tests/phpunit/plugin/ApiVersionTest.php index c068f25ce..faa68200d 100644 --- a/tests/phpunit/plugin/ApiVersionTest.php +++ b/tests/phpunit/plugin/ApiVersionTest.php @@ -32,7 +32,7 @@ class ApiVersionTest extends TestCase{ * @return \Generator|mixed[][] * @phpstan-return \Generator */ - public function compatibleApiProvider() : \Generator{ + public static function compatibleApiProvider() : \Generator{ yield ["3.0.0", "3.0.0", true]; yield ["3.1.0", "3.0.0", true]; yield ["3.0.0", "3.1.0", false]; @@ -58,7 +58,7 @@ class ApiVersionTest extends TestCase{ * @return mixed[][][] * @phpstan-return \Generator, list}, void, void> */ - public function ambiguousVersionsProvider() : \Generator{ + public static function ambiguousVersionsProvider() : \Generator{ yield [["3.0.0"], []]; yield [["3.0.0", "3.0.1"], ["3.0.0", "3.0.1"]]; yield [["3.0.0", "3.1.0", "4.0.0"], ["3.0.0", "3.1.0"]]; diff --git a/tests/phpunit/utils/CloningRegistryTraitTest.php b/tests/phpunit/utils/CloningRegistryTraitTest.php index 2cf10bed1..7f8298ff9 100644 --- a/tests/phpunit/utils/CloningRegistryTraitTest.php +++ b/tests/phpunit/utils/CloningRegistryTraitTest.php @@ -30,7 +30,7 @@ final class CloningRegistryTraitTest extends TestCase{ /** * @phpstan-return \Generator */ - public function cloningRegistryMembersProvider() : \Generator{ + public static function cloningRegistryMembersProvider() : \Generator{ yield [function() : \stdClass{ return TestCloningRegistry::TEST1(); }]; yield [function() : \stdClass{ return TestCloningRegistry::TEST2(); }]; yield [function() : \stdClass{ return TestCloningRegistry::TEST3(); }]; diff --git a/tests/phpunit/utils/ConfigTest.php b/tests/phpunit/utils/ConfigTest.php index 76b1a4b71..55b4bc2d4 100644 --- a/tests/phpunit/utils/ConfigTest.php +++ b/tests/phpunit/utils/ConfigTest.php @@ -32,7 +32,7 @@ class ConfigTest extends TestCase{ * @return \Generator|mixed[][] * @phpstan-return \Generator */ - public function fixYamlIndexesProvider() : \Generator{ + public static function fixYamlIndexesProvider() : \Generator{ yield ["x: 1\ny: 2\nz: 3\n", [ "x" => 1, "y" => 2, diff --git a/tests/phpunit/utils/UtilsTest.php b/tests/phpunit/utils/UtilsTest.php index ab93d73c3..f061abac2 100644 --- a/tests/phpunit/utils/UtilsTest.php +++ b/tests/phpunit/utils/UtilsTest.php @@ -44,7 +44,7 @@ class UtilsTest extends TestCase{ * @return string[][] * @phpstan-return list */ - public function parseDocCommentNewlineProvider() : array{ + public static function parseDocCommentNewlineProvider() : array{ return [ ["\t/**\r\n\t * @param PlayerJoinEvent \$event\r\n\t * @priority HIGHEST\r\n\t * @notHandler\r\n\t */"], ["\t/**\n\t * @param PlayerJoinEvent \$event\n\t * @priority HIGHEST\n\t * @notHandler\n\t */"], @@ -68,7 +68,7 @@ class UtilsTest extends TestCase{ * @return string[][] * @phpstan-return list */ - public function parseDocCommentOneLineProvider() : array{ + public static function parseDocCommentOneLineProvider() : array{ return [ ["/** @ignoreCancelled true dummy */"], ["/**@ignoreCancelled true dummy*/"], @@ -105,7 +105,7 @@ class UtilsTest extends TestCase{ * @return string[][] * @return list */ - public function validInstanceProvider() : array{ + public static function validInstanceProvider() : array{ return [ //direct instance / implement / extend [TestInstantiableClass::class, TestInstantiableClass::class], @@ -133,7 +133,7 @@ class UtilsTest extends TestCase{ * @return string[][] * @return list */ - public function validInstanceInvalidCombinationsProvider() : array{ + public static function validInstanceInvalidCombinationsProvider() : array{ return [ ["iDontExist abc", TestInstantiableClass::class], [TestInstantiableClass::class, "iDon'tExist abc"], diff --git a/tests/phpunit/world/format/io/region/RegionLoaderTest.php b/tests/phpunit/world/format/io/region/RegionLoaderTest.php index e4db90072..ee96b6bc0 100644 --- a/tests/phpunit/world/format/io/region/RegionLoaderTest.php +++ b/tests/phpunit/world/format/io/region/RegionLoaderTest.php @@ -74,7 +74,7 @@ class RegionLoaderTest extends TestCase{ * @return \Generator|int[][] * @phpstan-return \Generator */ - public function outOfBoundsCoordsProvider() : \Generator{ + public static function outOfBoundsCoordsProvider() : \Generator{ yield [-1, -1]; yield [32, 32]; yield [-1, 32]; diff --git a/tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php b/tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php index 597af06d3..498e2767e 100644 --- a/tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php +++ b/tests/phpunit/world/format/io/region/RegionLocationTableEntryTest.php @@ -31,7 +31,7 @@ class RegionLocationTableEntryTest extends TestCase{ /** * @phpstan-return \Generator */ - public function overlapDataProvider() : \Generator{ + public static function overlapDataProvider() : \Generator{ yield [new RegionLocationTableEntry(2, 1, 0), new RegionLocationTableEntry(2, 1, 0), true]; yield [new RegionLocationTableEntry(2, 1, 0), new RegionLocationTableEntry(3, 1, 0), false]; yield [new RegionLocationTableEntry(2, 2, 0), new RegionLocationTableEntry(3, 2, 0), true];