Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Excel5.php 2 locations

@@ 3086-3108 (lines=23) @@
3083
    /**
3084
     * Read HEADER record
3085
     */
3086
    private function readHeader()
3087
    {
3088
        $length = self::getInt2d($this->data, $this->pos + 2);
3089
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3090
3091
        // move stream pointer to next record
3092
        $this->pos += 4 + $length;
3093
3094
        if (!$this->readDataOnly) {
3095
            // offset: 0; size: var
3096
            // realized that $recordData can be empty even when record exists
3097
            if ($recordData) {
3098
                if ($this->version == self::XLS_BIFF8) {
3099
                    $string = self::readUnicodeStringLong($recordData);
3100
                } else {
3101
                    $string = $this->readByteStringShort($recordData);
3102
                }
3103
3104
                $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
3105
                $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
3106
            }
3107
        }
3108
    }
3109
3110
    /**
3111
     * Read FOOTER record
@@ 3113-3134 (lines=22) @@
3110
    /**
3111
     * Read FOOTER record
3112
     */
3113
    private function readFooter()
3114
    {
3115
        $length = self::getInt2d($this->data, $this->pos + 2);
3116
        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
3117
3118
        // move stream pointer to next record
3119
        $this->pos += 4 + $length;
3120
3121
        if (!$this->readDataOnly) {
3122
            // offset: 0; size: var
3123
            // realized that $recordData can be empty even when record exists
3124
            if ($recordData) {
3125
                if ($this->version == self::XLS_BIFF8) {
3126
                    $string = self::readUnicodeStringLong($recordData);
3127
                } else {
3128
                    $string = $this->readByteStringShort($recordData);
3129
                }
3130
                $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
3131
                $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
3132
            }
3133
        }
3134
    }
3135
3136
    /**
3137
     * Read HCENTER record