Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 2 locations

@@ 3126-3148 (lines=23) @@
3123
    /**
3124
     * Read HEADER record.
3125
     */
3126
    private function readHeader()
3127
    {
3128
        $length = self::getInt2d($this->data, $this->pos + 2);
3129
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3130
3131
        // move stream pointer to next record
3132
        $this->pos += 4 + $length;
3133
3134
        if (!$this->readDataOnly) {
3135
            // offset: 0; size: var
3136
            // realized that $recordData can be empty even when record exists
3137
            if ($recordData) {
3138
                if ($this->version == self::XLS_BIFF8) {
3139
                    $string = self::readUnicodeStringLong($recordData);
3140
                } else {
3141
                    $string = $this->readByteStringShort($recordData);
3142
                }
3143
3144
                $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
3145
                $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
3146
            }
3147
        }
3148
    }
3149
3150
    /**
3151
     * Read FOOTER record.
@@ 3153-3174 (lines=22) @@
3150
    /**
3151
     * Read FOOTER record.
3152
     */
3153
    private function readFooter()
3154
    {
3155
        $length = self::getInt2d($this->data, $this->pos + 2);
3156
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3157
3158
        // move stream pointer to next record
3159
        $this->pos += 4 + $length;
3160
3161
        if (!$this->readDataOnly) {
3162
            // offset: 0; size: var
3163
            // realized that $recordData can be empty even when record exists
3164
            if ($recordData) {
3165
                if ($this->version == self::XLS_BIFF8) {
3166
                    $string = self::readUnicodeStringLong($recordData);
3167
                } else {
3168
                    $string = $this->readByteStringShort($recordData);
3169
                }
3170
                $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
3171
                $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
3172
            }
3173
        }
3174
    }
3175
3176
    /**
3177
     * Read HCENTER record.