Box\Spout\Reader\XLSX\RowIterator::processRowStartingNode PHP Method

processRowStartingNode() protected method

protected processRowStartingNode ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader ) : integer
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object, positioned on a "" starting node
return integer A return code that indicates what action should the processor take next
    protected function processRowStartingNode($xmlReader)
    {
        // Reset index of the last processed column
        $this->lastColumnIndexProcessed = -1;
        // Mark the last processed row as the one currently being read
        $this->lastRowIndexProcessed = $this->getRowIndex($xmlReader);
        // Read spans info if present
        $numberOfColumnsForRow = $this->numColumns;
        $spans = $xmlReader->getAttribute(self::XML_ATTRIBUTE_SPANS);
        // returns '1:5' for instance
        if ($spans) {
            list(, $numberOfColumnsForRow) = explode(':', $spans);
            $numberOfColumnsForRow = intval($numberOfColumnsForRow);
        }
        $this->currentlyProcessedRowData = $numberOfColumnsForRow !== 0 ? array_fill(0, $numberOfColumnsForRow, '') : [];
        return XMLProcessor::PROCESSING_CONTINUE;
    }