Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 2 locations

@@ 3262-3284 (lines=23) @@
3259
    /**
3260
     * Read HEADER record.
3261
     */
3262
    private function readHeader()
3263
    {
3264
        $length = self::getUInt2d($this->data, $this->pos + 2);
3265
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3266
3267
        // move stream pointer to next record
3268
        $this->pos += 4 + $length;
3269
3270
        if (!$this->readDataOnly) {
3271
            // offset: 0; size: var
3272
            // realized that $recordData can be empty even when record exists
3273
            if ($recordData) {
3274
                if ($this->version == self::XLS_BIFF8) {
3275
                    $string = self::readUnicodeStringLong($recordData);
3276
                } else {
3277
                    $string = $this->readByteStringShort($recordData);
3278
                }
3279
3280
                $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
3281
                $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
3282
            }
3283
        }
3284
    }
3285
3286
    /**
3287
     * Read FOOTER record.
@@ 3289-3310 (lines=22) @@
3286
    /**
3287
     * Read FOOTER record.
3288
     */
3289
    private function readFooter()
3290
    {
3291
        $length = self::getUInt2d($this->data, $this->pos + 2);
3292
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3293
3294
        // move stream pointer to next record
3295
        $this->pos += 4 + $length;
3296
3297
        if (!$this->readDataOnly) {
3298
            // offset: 0; size: var
3299
            // realized that $recordData can be empty even when record exists
3300
            if ($recordData) {
3301
                if ($this->version == self::XLS_BIFF8) {
3302
                    $string = self::readUnicodeStringLong($recordData);
3303
                } else {
3304
                    $string = $this->readByteStringShort($recordData);
3305
                }
3306
                $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
3307
                $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
3308
            }
3309
        }
3310
    }
3311
3312
    /**
3313
     * Read HCENTER record.