Code Duplication    Length = 4-5 lines in 2 locations

src/PhpSpreadsheet/Calculation.php 2 locations

@@ 2416-2419 (lines=4) @@
2413
                $i = false;
2414
                foreach ($temp as &$value) {
2415
                    //    Only count/replace in alternating array entries
2416
                    if ($i = !$i) {
2417
                        $value = preg_replace($from, $to, $value);
2418
                        $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
2419
                    }
2420
                }
2421
                unset($value);
2422
                //    Then rebuild the formula string
@@ 2424-2428 (lines=5) @@
2421
                unset($value);
2422
                //    Then rebuild the formula string
2423
                $formula = implode('"', $temp);
2424
            } else {
2425
                //    If there's no quoted strings, then we do a simple count/replace
2426
                $formula = preg_replace($from, $to, $formula);
2427
                $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
2428
            }
2429
        }
2430
2431
        return $formula;