Code Duplication    Length = 6-6 lines in 2 locations

src/PhpSpreadsheet/Calculation/Financial.php 2 locations

@@ 1947-1952 (lines=6) @@
1944
        $guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
1945
1946
        $rate = $guess;
1947
        if (abs($rate) < self::FINANCIAL_PRECISION) {
1948
            $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
1949
        } else {
1950
            $f = exp($nper * log(1 + $rate));
1951
            $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1952
        }
1953
        $y0 = $pv + $pmt * $nper + $fv;
1954
        $y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1955
@@ 1966-1971 (lines=6) @@
1963
            if (($nper * abs($pmt)) > ($pv - $fv)) {
1964
                $x1 = abs($x1);
1965
            }
1966
            if (abs($rate) < self::FINANCIAL_PRECISION) {
1967
                $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
1968
            } else {
1969
                $f = exp($nper * log(1 + $rate));
1970
                $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
1971
            }
1972
1973
            $y0 = $y1;
1974
            $y1 = $y;