Code Duplication    Length = 22-23 lines in 2 locations

src/PhpSpreadsheet/Reader/Xls.php 2 locations

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