fix PHPstan

This commit is contained in:
ShockedPlot7560 2025-07-30 11:35:18 +02:00
parent 930c8a1f82
commit f5867851a5
No known key found for this signature in database
GPG Key ID: DA556CD1E163F070

View File

@ -196,7 +196,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
* describe the bottom type of a type hierarchy only containing Block. * describe the bottom type of a type hierarchy only containing Block.
* *
* @var \Closure[] * @var \Closure[]
* @phpstan-var array<int, \Closure(never) : Writer|string> * @phpstan-var array<int, (\Closure(never) : Writer|string)>
*/ */
private array $serializers = []; private array $serializers = [];
@ -233,7 +233,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
/** /**
* @phpstan-template TBlockType of Block * @phpstan-template TBlockType of Block
* @phpstan-param TBlockType $block * @phpstan-param TBlockType $block
* @phpstan-param \Closure(TBlockType) : Writer|string $serializer * @phpstan-param (\Closure(TBlockType) : Writer|string) $serializer
*/ */
public function map(Block $block, \Closure $serializer) : void{ public function map(Block $block, \Closure $serializer) : void{
if(isset($this->serializers[$block->getTypeId()])){ if(isset($this->serializers[$block->getTypeId()])){
@ -278,7 +278,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
* In the future we'll need some way to guarantee that type IDs are never reused (perhaps spl_object_id()?) * In the future we'll need some way to guarantee that type IDs are never reused (perhaps spl_object_id()?)
* *
* @var \Closure $serializer * @var \Closure $serializer
* @phpstan-var \Closure(TBlockType) : Writer|string $serializer * @phpstan-var (\Closure(TBlockType) : Writer|string) $serializer
*/ */
$serializer = $locatedSerializer; $serializer = $locatedSerializer;