$fields Fields belonging to the step. */ public function __construct( private int $index = 0, private string $title = '', private string $description = '', private array $fields = array() ) {} /** * Returns the position of the step. */ public function index(): int { return $this->index; } /** * Returns the heading. */ public function title(): string { return $this->title; } /** * Returns the text under the heading. */ public function description(): string { return $this->description; } /** * Returns the fields belonging to the step. * * @return array The fields. */ public function fields(): array { return $this->fields; } /** * Returns the keys of the fields belonging to the step. * * @return array The field keys. */ public function field_keys(): array { return array_map( static fn( Field $field ): string => $field->field_key(), $this->fields ); } /** * Determines whether the step holds any fields. * * @return bool True when the step is empty. */ public function is_empty(): bool { return array() === $this->fields; } }