public function setHeaderRow(array $row)
    {
        if (null === $this->nbColumns) {
            $this->nbColumns = count($row);
        } elseif (count($row) !== $this->nbColumns) {
            throw new LogicException(sprintf(
                'Expected the header row to contain %s cells, but got %s.',
                $this->nbColumns,
                count($row)
            ));
        }

        $this->headerRow = array_values($row);

        return $this;
    }
public function setHeaderRow(array $row)
    {
        if (null === $this->nbColumns) {
            $this->nbColumns = count($row);
        } elseif (count($row) !== $this->nbColumns) {
            throw new LogicException(sprintf(
                'Expected the header row to contain %s cells, but got %s.',
                $this->nbColumns,
                count($row)
            ));
        }

        $this->headerRow = array_values($row);

        return $this;
    }
public function setHeaderRow ( array $ row ) { if ( null === $ this -> nbColumns ) { $ this -> nbColumns = count ( $ row ) ; } elseif ( count ( $ row ) !== $ this -> nbColumns ) { throw new LogicException ( sprintf ( 'Expected the header row to contain %s cells, but got %s.' , $ this -> nbColumns , count ( $ row ) ) ) ; } $ this -> headerRow = array_values ( $ row ) ; return $ this ; }
Sets the header cells of the table.

@param string[] $row The header cells.

@return static The current instance.

@throws LogicException If the row contains more or less columns than
rows previously added to the table.
Sets the header cells of the table .