Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Calculation.php 2 locations

@@ 3186-3191 (lines=6) @@
3183
                return $this->raiseFormulaError("Formula Error: Illegal character '~'");                //        on the stack but not in the input expression
3184
            } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {    //    Are we putting an operator on the stack?
3185
//echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL;
3186
                while ($stack->count() > 0 &&
3187
                    ($o2 = $stack->last()) &&
3188
                    isset(self::$operators[$o2['value']]) &&
3189
                    @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3190
                    $output[] = $stack->pop();                                //    Swap operands and higher precedence operators from the stack to the output
3191
                }
3192
                $stack->push('Binary Operator', $opCharacter);    //    Finally put our current operator onto the stack
3193
                ++$index;
3194
                $expectingOperator = false;
@@ 3457-3462 (lines=6) @@
3454
                if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) &&
3455
                    ($output[count($output)-1]['type'] == 'Cell Reference')) {
3456
//                    echo 'Element is an Intersect Operator<br />';
3457
                    while ($stack->count() > 0 &&
3458
                        ($o2 = $stack->last()) &&
3459
                        isset(self::$operators[$o2['value']]) &&
3460
                        @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
3461
                        $output[] = $stack->pop();                                //    Swap operands and higher precedence operators from the stack to the output
3462
                    }
3463
                    $stack->push('Binary Operator', '|');    //    Put an Intersect Operator on the stack
3464
                    $expectingOperator = false;
3465
                }