1 | <?php |
||
9 | class EqualPrincipalPaymentAmountCalculator implements PaymentAmountCalculatorInterface |
||
10 | { |
||
11 | /** |
||
12 | * @param array $periods |
||
13 | * @param float $presentValue |
||
14 | * @param float $interestRate |
||
15 | * @param float $futureValue |
||
16 | * @return array |
||
17 | */ |
||
18 | 4 | public function getPaymentAmounts( |
|
44 | |||
45 | /** |
||
46 | * @param $interestRate |
||
47 | * @param $periodLength |
||
48 | * @return float |
||
49 | */ |
||
50 | 4 | private function getPeriodInterestRate(float $interestRate, float $periodLength): float |
|
55 | |||
56 | /** |
||
57 | * @param float $presentValue |
||
58 | * @param float $futureValue |
||
59 | * @param int $noOfPeriods |
||
60 | * @return float |
||
61 | */ |
||
62 | 4 | private function getPrincipalPart(float $presentValue, float $futureValue, int $noOfPeriods): float |
|
68 | |||
69 | /** |
||
70 | * @param float $presentValue |
||
71 | * @param float $futureValue |
||
72 | * @param float $ratePerPeriod |
||
73 | * @param int $numberOfPeriods |
||
74 | * @return float |
||
75 | */ |
||
76 | 4 | private function getPaymentAmount( |
|
92 | } |
||
93 |