Code Duplication    Length = 5-5 lines in 2 locations

src/PhpSpreadsheet/Writer/Xls/Parser.php 2 locations

@@ 1018-1022 (lines=5) @@
1015
        while ($i < $formula_length) {
1016
            $token .= $this->formula[$i];
1017
1018
            if ($i < ($formula_length - 1)) {
1019
                $this->lookAhead = $this->formula[$i + 1];
1020
            } else {
1021
                $this->lookAhead = '';
1022
            }
1023
1024
            if ($this->match($token) != '') {
1025
                $this->currentCharacter = $i + 1;
@@ 1031-1035 (lines=5) @@
1028
                return 1;
1029
            }
1030
1031
            if ($i < ($formula_length - 2)) {
1032
                $this->lookAhead = $this->formula[$i + 2];
1033
            } else { // if we run out of characters lookAhead becomes empty
1034
                $this->lookAhead = '';
1035
            }
1036
            ++$i;
1037
        }
1038
        //die("Lexical error ".$this->currentCharacter);