> */ public array $headers; /** * The table rows. * * @var array> */ public array $rows; /** * Create a new Table instance. * * @param array>|Collection> $headers * @param array>|Collection> $rows * * @phpstan-param ($rows is null ? list>|Collection> : list>|Collection>) $headers */ public function __construct(array|Collection $headers = [], array|Collection|null $rows = null) { if ($rows === null) { $rows = $headers; $headers = []; } $this->headers = $headers instanceof Collection ? $headers->all() : $headers; $this->rows = $rows instanceof Collection ? $rows->all() : $rows; } /** * Display the table. */ public function display(): void { $this->prompt(); } /** * Display the table. */ public function prompt(): bool { $this->capturePreviousNewLines(); $this->state = 'submit'; static::output()->write($this->renderTheme()); return true; } /** * Get the value of the prompt. */ public function value(): bool { return true; } }