Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Calculation/Financial.php 2 locations

@@ 1931-1936 (lines=6) @@
1928
        $guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
1929
1930
        $rate = $guess;
1931
        if (abs($rate) < self::FINANCIAL_PRECISION) {
1932
            $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
1933
        } else {
1934
            $f = exp($nper * log(1 + $rate));
1935
            $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1936
        }
1937
        $y0 = $pv + $pmt * $nper + $fv;
1938
        $y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1939
@@ 1950-1955 (lines=6) @@
1947
            if (($nper * abs($pmt)) > ($pv - $fv)) {
1948
                $x1 = abs($x1);
1949
            }
1950
            if (abs($rate) < self::FINANCIAL_PRECISION) {
1951
                $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
1952
            } else {
1953
                $f = exp($nper * log(1 + $rate));
1954
                $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1955
            }
1956
1957
            $y0 = $y1;
1958
            $y1 = $y;