Passed
Push — master ( b66789...fff5ae )
by Kauri
54s
created

InterestAmountCalculator::getInterestAmount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Kauri\Loan;
6
7
8
class InterestAmountCalculator implements InterestAmountCalculatorInterface
9
{
10
    /**
11
     * @param float $presentValue
12
     * @param float $ratePerPeriod
13
     * @return float
14
     */
15 4
    public function getInterestAmount(float $presentValue, float $ratePerPeriod): float
16
    {
17 4
        $interestAmount = ($presentValue * ($ratePerPeriod / 100));
18 4
        return $interestAmount;
19
    }
20
21
}
22