Code Duplication    Length = 5-5 lines in 2 locations

src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php 2 locations

@@ 144-148 (lines=5) @@
141
     */
142
    public function next()
143
    {
144
        do {
145
            ++$this->currentRow;
146
        } while (($this->onlyExistingCells) &&
147
            (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
148
            ($this->currentRow <= $this->endRow));
149
    }
150
151
    /**
@@ 160-164 (lines=5) @@
157
            throw new PhpSpreadsheetException("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
158
        }
159
160
        do {
161
            --$this->currentRow;
162
        } while (($this->onlyExistingCells) &&
163
            (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
164
            ($this->currentRow >= $this->startRow));
165
    }
166
167
    /**