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

InterestAmountCalculator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInterestAmount() 0 5 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