Code Duplication    Length = 4-5 lines in 2 locations

src/PhpSpreadsheet/Calculation.php 2 locations

@@ 2381-2384 (lines=4) @@
2378
                $i = false;
2379
                foreach ($temp as &$value) {
2380
                    //    Only count/replace in alternating array entries
2381
                    if ($i = !$i) {
2382
                        $value = preg_replace($from, $to, $value);
2383
                        $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
2384
                    }
2385
                }
2386
                unset($value);
2387
                //    Then rebuild the formula string
@@ 2389-2393 (lines=5) @@
2386
                unset($value);
2387
                //    Then rebuild the formula string
2388
                $formula = implode('"', $temp);
2389
            } else {
2390
                //    If there's no quoted strings, then we do a simple count/replace
2391
                $formula = preg_replace($from, $to, $formula);
2392
                $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
2393
            }
2394
        }
2395
2396
        return $formula;