Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Excel5.php 2 locations

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