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 | 3 | public function getPaymentAmounts( |
|
44 | |||
45 | /** |
||
46 | * @param float $presentValue |
||
47 | * @param float $discount |
||
48 | * @return float |
||
49 | */ |
||
50 | 3 | private function decreasePrincipalLeft(float $presentValue, float $discount) |
|
54 | |||
55 | /** |
||
56 | * @param $interestRate |
||
57 | * @param $periodLength |
||
58 | * @return float |
||
59 | */ |
||
60 | 3 | private function getPeriodInterestRate(float $interestRate, float $periodLength): float |
|
65 | |||
66 | /** |
||
67 | * @param float $presentValue |
||
68 | * @param float $futureValue |
||
69 | * @param int $noOfPeriods |
||
70 | * @return float |
||
71 | */ |
||
72 | 3 | private function getPrincipalPart(float $presentValue, float $futureValue, int $noOfPeriods): float |
|
78 | |||
79 | /** |
||
80 | * @param float $presentValue |
||
81 | * @param float $futureValue |
||
82 | * @param float $ratePerPeriod |
||
83 | * @param int $numberOfPeriods |
||
84 | * @return float |
||
85 | */ |
||
86 | 3 | private function getPaymentAmount( |
|
102 | } |
||
103 |