PocketMine-MP 5.32.2 git-1ebd7d3960d713d56f77f610fe0c15cdee201069
Loading...
Searching...
No Matches
pocketmine\data\bedrock\block\convert\Model Class Reference
+ Collaboration diagram for pocketmine\data\bedrock\block\convert\Model:

Public Member Functions

 getBlock ()
 
 getId ()
 
 getProperties ()
 
 properties (array $properties)
 

Static Public Member Functions

static create (Block $block, string $id)
 

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

Definition at line 37 of file Model.php.

Member Function Documentation

◆ create()

static pocketmine\data\bedrock\block\convert\Model::create ( Block $block,
string $id )
static

@phpstan-template TBlock_ of Block @phpstan-param TBlock_ $block @phpstan-return self<TBlock_>

Definition at line 69 of file Model.php.

◆ getBlock()

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

@phpstan-return TBlock

Definition at line 54 of file Model.php.

◆ getId()

pocketmine\data\bedrock\block\convert\Model::getId ( )

Definition at line 56 of file Model.php.

◆ getProperties()

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

Definition at line 62 of file Model.php.

◆ properties()

pocketmine\data\bedrock\block\convert\Model::properties ( array $properties)
Parameters
Property[]$properties@phpstan-param list<Property<contravariant TBlock>> $properties @phpstan-return $this

Definition at line 78 of file Model.php.


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