Code Duplication    Length = 4-5 lines in 2 locations

src/PhpSpreadsheet/Calculation/Calculation.php 2 locations

@@ 2336-2339 (lines=4) @@
2333
                $i = false;
2334
                foreach ($temp as &$value) {
2335
                    //    Only count/replace in alternating array entries
2336
                    if ($i = !$i) {
2337
                        $value = preg_replace($from, $to, $value);
2338
                        $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
2339
                    }
2340
                }
2341
                unset($value);
2342
                //    Then rebuild the formula string
@@ 2344-2348 (lines=5) @@
2341
                unset($value);
2342
                //    Then rebuild the formula string
2343
                $formula = implode('"', $temp);
2344
            } else {
2345
                //    If there's no quoted strings, then we do a simple count/replace
2346
                $formula = preg_replace($from, $to, $formula);
2347
                $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
2348
            }
2349
        }
2350
2351
        return $formula;