Code Duplication    Length = 32-34 lines in 2 locations

src/PhpSpreadsheet/Reader/Excel5.php 2 locations

@@ 3609-3642 (lines=34) @@
3606
     * --    "OpenOffice.org's Documentation of the Microsoft
3607
     *         Excel File Format"
3608
     */
3609
    private function readRk()
3610
    {
3611
        $length = self::getInt2d($this->data, $this->pos + 2);
3612
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3613
3614
        // move stream pointer to next record
3615
        $this->pos += 4 + $length;
3616
3617
        // offset: 0; size: 2; index to row
3618
        $row = self::getInt2d($recordData, 0);
3619
3620
        // offset: 2; size: 2; index to column
3621
        $column = self::getInt2d($recordData, 2);
3622
        $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column);
3623
3624
        // Read cell?
3625
        if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
3626
            // offset: 4; size: 2; index to XF record
3627
            $xfIndex = self::getInt2d($recordData, 4);
3628
3629
            // offset: 6; size: 4; RK value
3630
            $rknum = self::getInt4d($recordData, 6);
3631
            $numValue = self::getIEEE754($rknum);
3632
3633
            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3634
            if (!$this->readDataOnly) {
3635
                // add style information
3636
                $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
3637
            }
3638
3639
            // add cell
3640
            $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC);
3641
        }
3642
    }
3643
3644
3645
    /**
@@ 3793-3824 (lines=32) @@
3790
     * --    "OpenOffice.org's Documentation of the Microsoft
3791
     *         Excel File Format"
3792
     */
3793
    private function readNumber()
3794
    {
3795
        $length = self::getInt2d($this->data, $this->pos + 2);
3796
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3797
3798
        // move stream pointer to next record
3799
        $this->pos += 4 + $length;
3800
3801
        // offset: 0; size: 2; index to row
3802
        $row = self::getInt2d($recordData, 0);
3803
3804
        // offset: 2; size 2; index to column
3805
        $column = self::getInt2d($recordData, 2);
3806
        $columnString = \PhpSpreadsheet\Cell::stringFromColumnIndex($column);
3807
3808
        // Read cell?
3809
        if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
3810
            // offset 4; size: 2; index to XF record
3811
            $xfIndex = self::getInt2d($recordData, 4);
3812
3813
            $numValue = self::extractNumber(substr($recordData, 6, 8));
3814
3815
            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3816
            if (!$this->readDataOnly) {
3817
                // add cell style
3818
                $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
3819
            }
3820
3821
            // add cell value
3822
            $cell->setValueExplicit($numValue, \PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC);
3823
        }
3824
    }
3825
3826
3827
    /**