PocketMine-MP 5.42.1 git-d77520d210fcb967a02bc11817ad625393c8ebc6
Loading...
Searching...
No Matches
pocketmine\data\bedrock\block\convert\FlattenedIdModel Class Reference
+ Collaboration diagram for pocketmine\data\bedrock\block\convert\FlattenedIdModel:

Public Member Functions

 getBlock ()
 
 getIdComponents ()
 
 getProperties ()
 
 idComponents (array $components)
 
 properties (array $properties)
 

Static Public Member Functions

static create (Block $block)
 

Detailed Description

This class works around a limitation in PHPStan. Ideally, we'd just have a function that accepted ($block, $id, $properties) all together and just have the template type inferred from $block alone. However, there's no way to tell PHPStan to ignore $properties for inference, so we're stuck with this hack.

@phpstan-template TBlock of Block @phpstan-template THasIdComponents of bool

Definition at line 39 of file FlattenedIdModel.php.

Member Function Documentation

◆ create()

static pocketmine\data\bedrock\block\convert\FlattenedIdModel::create ( Block $block)
static

@phpstan-template TBlock_ of Block @phpstan-param TBlock_ $block

Returns
self<TBlock_, false>

Definition at line 65 of file FlattenedIdModel.php.

◆ getBlock()

pocketmine\data\bedrock\block\convert\FlattenedIdModel::getBlock ( )

@phpstan-return TBlock

Definition at line 72 of file FlattenedIdModel.php.

◆ getIdComponents()

pocketmine\data\bedrock\block\convert\FlattenedIdModel::getIdComponents ( )
Returns
string[]|StringProperty[] @phpstan-return list<string|StringProperty<contravariant TBlock>>

Definition at line 78 of file FlattenedIdModel.php.

◆ getProperties()

pocketmine\data\bedrock\block\convert\FlattenedIdModel::getProperties ( )
Returns
Property[] @phpstan-return list<Property<contravariant TBlock>>

Definition at line 84 of file FlattenedIdModel.php.

◆ idComponents()

pocketmine\data\bedrock\block\convert\FlattenedIdModel::idComponents ( array $components)
Parameters
string[] | StringProperty[]$components@phpstan-param non-empty-list<string|StringProperty<contravariant TBlock>> $components
Returns
$this @phpstan-this-out self<TBlock, true>

Definition at line 92 of file FlattenedIdModel.php.

◆ properties()

pocketmine\data\bedrock\block\convert\FlattenedIdModel::properties ( array $properties)
Parameters
Property[]$properties@phpstan-param non-empty-list<Property<contravariant TBlock>> $properties
Returns
$this @phpstan-this-out self<TBlock, THasIdComponents>

Definition at line 103 of file FlattenedIdModel.php.


The documentation for this class was generated from the following file: