Code Duplication    Length = 4-5 lines in 2 locations

src/PhpSpreadsheet/Calculation.php 2 locations

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