Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 2 locations

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