|null * @required */ public ?array $oldState; /** * Either this or newFlattenedName must be present * Due to technical limitations of jsonmapper, we can't use a union type here */ public string $newName; /** * Either this or newName must be present * Due to technical limitations of jsonmapper, we can't use a union type here */ public BlockStateUpgradeSchemaModelFlattenInfo $newFlattenedName; /** * @var BlockStateUpgradeSchemaModelTag[]|null * @phpstan-var array|null * @required */ public ?array $newState; /** * @var string[] * @phpstan-var list * May not be present in older schemas */ public array $copiedState; /** * @param BlockStateUpgradeSchemaModelTag[] $oldState * @param BlockStateUpgradeSchemaModelTag[] $newState * @param string[] $copiedState * @phpstan-param array $oldState * @phpstan-param array $newState * @phpstan-param list $copiedState */ public function __construct(array $oldState, string|BlockStateUpgradeSchemaModelFlattenInfo $newNameRule, array $newState, array $copiedState){ $this->oldState = count($oldState) === 0 ? null : $oldState; if($newNameRule instanceof BlockStateUpgradeSchemaModelFlattenInfo){ $this->newFlattenedName = $newNameRule; }else{ $this->newName = $newNameRule; } $this->newState = count($newState) === 0 ? null : $newState; $this->copiedState = $copiedState; } }