<?php

namespace Planaday\Config\OptionGroups;

use Planaday\Config\OptionTypes\Option;

class OptionGroup {
	/** @var null|string */
	protected $index;

	/** @var string */
	protected $name;

	/** @var string */
	protected $description;

	/** @var array<Option|OptionGroup> */
	protected $layout;

	/**
	 * @param null|string $index
	 * @param string $name
	 * @param string $description
	 * @param array<Option|OptionGroup> $layout
	 */
	public function __construct(?string $index, string $name, string $description, array $layout) {
		$this->index = $index;
		$this->name = $name;
		$this->description = $description;
		$this->layout = $layout;
	}

	/**
	 * @return string
	 */
	public function getName(): string {
		return $this->name;
	}

	/**
	 * @return string
	 */
	public function getDescription(): string {
		return $this->description;
	}

	/**
	 * @return array<Option|OptionGroup>
	 */
	public function getLayout(): array {
		return $this->layout;
	}

	public function getIndex(): ?string {
		return $this->index;
	}
}