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;
    }