Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 2 locations

@@ 3102-3124 (lines=23) @@
3099
    /**
3100
     * Read HEADER record.
3101
     */
3102
    private function readHeader()
3103
    {
3104
        $length = self::getInt2d($this->data, $this->pos + 2);
3105
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3106
3107
        // move stream pointer to next record
3108
        $this->pos += 4 + $length;
3109
3110
        if (!$this->readDataOnly) {
3111
            // offset: 0; size: var
3112
            // realized that $recordData can be empty even when record exists
3113
            if ($recordData) {
3114
                if ($this->version == self::XLS_BIFF8) {
3115
                    $string = self::readUnicodeStringLong($recordData);
3116
                } else {
3117
                    $string = $this->readByteStringShort($recordData);
3118
                }
3119
3120
                $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
3121
                $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
3122
            }
3123
        }
3124
    }
3125
3126
    /**
3127
     * Read FOOTER record.
@@ 3129-3150 (lines=22) @@
3126
    /**
3127
     * Read FOOTER record.
3128
     */
3129
    private function readFooter()
3130
    {
3131
        $length = self::getInt2d($this->data, $this->pos + 2);
3132
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3133
3134
        // move stream pointer to next record
3135
        $this->pos += 4 + $length;
3136
3137
        if (!$this->readDataOnly) {
3138
            // offset: 0; size: var
3139
            // realized that $recordData can be empty even when record exists
3140
            if ($recordData) {
3141
                if ($this->version == self::XLS_BIFF8) {
3142
                    $string = self::readUnicodeStringLong($recordData);
3143
                } else {
3144
                    $string = $this->readByteStringShort($recordData);
3145
                }
3146
                $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
3147
                $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
3148
            }
3149
        }
3150
    }
3151
3152
    /**
3153
     * Read HCENTER record.