> $rows * @param array $totals */ public function __construct( public array $columns, public array $rows, public array $totals = [], ) {} /** @return array */ public function toArray(): array { return [ 'columns' => array_map(fn (Column $c) => $c->toArray(), $this->columns), 'rows' => $this->rows, 'totals' => $this->totals, ]; } }