1 | <?php |
||
18 | class EqualPrincipalPaymentScheduleCalculator implements PaymentScheduleCalculator |
||
19 | { |
||
20 | /** |
||
21 | * @var Period[] |
||
22 | */ |
||
23 | private $schedulePeriods; |
||
24 | |||
25 | /** |
||
26 | * @var float |
||
27 | */ |
||
28 | private $principalAmount; |
||
29 | |||
30 | /** |
||
31 | * @var float |
||
32 | */ |
||
33 | private $dailyInterestRate; |
||
34 | |||
35 | /** |
||
36 | * @var float |
||
37 | */ |
||
38 | private $totalInterest; |
||
39 | |||
40 | /** |
||
41 | * PaymentSchedule constructor. |
||
42 | * @param Period[] $schedulePeriods |
||
43 | * @param float $principalAmount |
||
44 | * @param float $dailyInterestRate |
||
45 | */ |
||
46 | 2 | public function __construct( |
|
56 | |||
57 | /** |
||
58 | * @return float |
||
59 | */ |
||
60 | 2 | public function getTotalInterest() |
|
64 | |||
65 | /** |
||
66 | * @param float $totalInterest |
||
67 | */ |
||
68 | public function setTotalInterest($totalInterest) |
||
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | 2 | public function calculateSchedule() |
|
103 | |||
104 | /** |
||
105 | * @param float $remainingPrincipalAmount |
||
106 | * @param float $dailyInterestRate |
||
107 | * @param integer $periodInDays |
||
108 | * @return float |
||
109 | */ |
||
110 | 2 | private function calculatePaymentInterest($remainingPrincipalAmount, $dailyInterestRate, $periodInDays) |
|
114 | } |