Merge 'minor-next' into 'major-next'

Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/11652590245
This commit is contained in:
github-actions
2024-11-03 15:33:37 +00:00
17 changed files with 644 additions and 167 deletions

View File

@ -580,11 +580,6 @@ parameters:
count: 1
path: ../../../src/network/mcpe/ChunkRequestTask.php
-
message: "#^Match expression does not handle remaining values\\: pocketmine\\\\crafting\\\\FurnaceType\\:\\:CAMPFIRE\\|pocketmine\\\\crafting\\\\FurnaceType\\:\\:SOUL_CAMPFIRE$#"
count: 1
path: ../../../src/network/mcpe/InventoryManager.php
-
message: "#^Cannot call method doFirstSpawn\\(\\) on pocketmine\\\\player\\\\Player\\|null\\.$#"
count: 1
@ -790,11 +785,6 @@ parameters:
count: 1
path: ../../../src/resourcepacks/ZippedResourcePack.php
-
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
count: 1
path: ../../../src/resourcepacks/ZippedResourcePack.php
-
message: "#^Property pocketmine\\\\resourcepacks\\\\ZippedResourcePack\\:\\:\\$fileResource \\(resource\\) does not accept resource\\|false\\.$#"
count: 1
@ -1040,11 +1030,6 @@ parameters:
count: 1
path: ../../../src/world/format/io/region/RegionLoader.php
-
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
count: 1
path: ../../../src/world/format/io/region/RegionLoader.php
-
message: "#^Parameter \\#2 \\$size of function ftruncate expects int\\<0, max\\>, int given\\.$#"
count: 1
@ -1195,18 +1180,3 @@ parameters:
count: 1
path: ../../../src/world/light/SkyLightUpdate.php
-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
count: 1
path: ../../phpunit/block/BlockTest.php
-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
count: 1
path: ../../phpunit/block/regenerate_consistency_check.php
-
message: "#^Parameter \\#1 \\$logFile of class pocketmine\\\\utils\\\\MainLogger constructor expects string, string\\|false given\\.$#"
count: 1
path: ../../phpunit/scheduler/AsyncPoolTest.php

View File

@ -5,20 +5,20 @@ parameters:
count: 1
path: ../../../src/block/CakeWithCandle.php
-
message: "#^Method pocketmine\\\\block\\\\DoubleTallGrass\\:\\:traitGetDropsForIncompatibleTool\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: ../../../src/block/DoubleTallGrass.php
-
message: "#^Method pocketmine\\\\block\\\\CopperDoor\\:\\:onInteractCopper\\(\\) has parameter \\$returnedItems with no value type specified in iterable type array\\.$#"
count: 1
path: ../../../src/block/utils/CopperTrait.php
path: ../../../src/block/CopperDoor.php
-
message: "#^Method pocketmine\\\\block\\\\CopperTrapdoor\\:\\:onInteractCopper\\(\\) has parameter \\$returnedItems with no value type specified in iterable type array\\.$#"
count: 1
path: ../../../src/block/utils/CopperTrait.php
path: ../../../src/block/CopperTrapdoor.php
-
message: "#^Method pocketmine\\\\block\\\\DoubleTallGrass\\:\\:traitGetDropsForIncompatibleTool\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: ../../../src/block/DoubleTallGrass.php
-
message: "#^Call to function assert\\(\\) with false and 'unknown hit type' will always evaluate to false\\.$#"

View File

@ -24,8 +24,10 @@ declare(strict_types=1);
namespace pocketmine\data\bedrock\block\upgrade;
use PHPUnit\Framework\TestCase;
use pocketmine\block\Block;
use pocketmine\data\bedrock\block\BlockStateData;
use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\StringTag;
use const PHP_INT_MAX;
class BlockStateUpgraderTest extends TestCase{
@ -210,6 +212,23 @@ class BlockStateUpgraderTest extends TestCase{
self::assertSame($upgradedStateData->getState(self::TEST_PROPERTY_2)?->getValue(), $valueAfter);
}
public function testFlattenProperty() : void{
$schema = $this->getNewSchema();
$schema->flattenedProperties[self::TEST_BLOCK] = new BlockStateUpgradeSchemaFlattenInfo(
"minecraft:",
"test",
"_suffix",
[],
StringTag::class
);
$stateData = new BlockStateData(self::TEST_BLOCK, ["test" => new StringTag("value1")], 0);
$upgradedStateData = $this->upgrade($stateData, fn() => $stateData);
self::assertSame("minecraft:value1_suffix", $upgradedStateData->getName());
self::assertEmpty($upgradedStateData->getStates());
}
/**
* @phpstan-return \Generator<int, array{int, int, bool, int}, void, void>
*/