Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Excel5.php 2 locations

@@ 3143-3165 (lines=23) @@
3140
    /**
3141
     * Read HEADER record
3142
     */
3143
    private function readHeader()
3144
    {
3145
        $length = self::getInt2d($this->data, $this->pos + 2);
3146
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3147
3148
        // move stream pointer to next record
3149
        $this->pos += 4 + $length;
3150
3151
        if (!$this->readDataOnly) {
3152
            // offset: 0; size: var
3153
            // realized that $recordData can be empty even when record exists
3154
            if ($recordData) {
3155
                if ($this->version == self::XLS_BIFF8) {
3156
                    $string = self::readUnicodeStringLong($recordData);
3157
                } else {
3158
                    $string = $this->readByteStringShort($recordData);
3159
                }
3160
3161
                $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
3162
                $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
3163
            }
3164
        }
3165
    }
3166
3167
3168
    /**
@@ 3171-3192 (lines=22) @@
3168
    /**
3169
     * Read FOOTER record
3170
     */
3171
    private function readFooter()
3172
    {
3173
        $length = self::getInt2d($this->data, $this->pos + 2);
3174
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3175
3176
        // move stream pointer to next record
3177
        $this->pos += 4 + $length;
3178
3179
        if (!$this->readDataOnly) {
3180
            // offset: 0; size: var
3181
            // realized that $recordData can be empty even when record exists
3182
            if ($recordData) {
3183
                if ($this->version == self::XLS_BIFF8) {
3184
                    $string = self::readUnicodeStringLong($recordData);
3185
                } else {
3186
                    $string = $this->readByteStringShort($recordData);
3187
                }
3188
                $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
3189
                $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
3190
            }
3191
        }
3192
    }
3193
3194
3195
    /**