Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Calculation/Calculation.php 2 locations

@@ 3122-3127 (lines=6) @@
3119
            } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) {    //    We have to explicitly deny a tilde or pipe, because they are legal
3120
                return $this->raiseFormulaError("Formula Error: Illegal character '~'"); //        on the stack but not in the input expression
3121
            } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {    //    Are we putting an operator on the stack?
3122
                while ($stack->count() > 0 &&
3123
                    ($o2 = $stack->last()) &&
3124
                    isset(self::$operators[$o2['value']]) &&
3125
                    @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3126
                    $output[] = $stack->pop(); //    Swap operands and higher precedence operators from the stack to the output
3127
                }
3128
                $stack->push('Binary Operator', $opCharacter); //    Finally put our current operator onto the stack
3129
                ++$index;
3130
                $expectingOperator = false;
@@ 3364-3369 (lines=6) @@
3361
                //        Cell References) then we have an INTERSECTION operator
3362
                if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) &&
3363
                    ($output[count($output) - 1]['type'] == 'Cell Reference')) {
3364
                    while ($stack->count() > 0 &&
3365
                        ($o2 = $stack->last()) &&
3366
                        isset(self::$operators[$o2['value']]) &&
3367
                        @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3368
                        $output[] = $stack->pop(); //    Swap operands and higher precedence operators from the stack to the output
3369
                    }
3370
                    $stack->push('Binary Operator', '|'); //    Put an Intersect Operator on the stack
3371
                    $expectingOperator = false;
3372
                }