3
3
namespace FinanCalc \Calculators {
4
4
5
5
use DateTime ;
6
+ use FinanCalc \Constants \Lambdas ;
6
7
use FinanCalc \Interfaces \Calculator \CalculatorAbstract ;
7
8
use FinanCalc \Utils \MathFuncs ;
8
9
use FinanCalc \Utils \Time \TimeSpan ;
@@ -70,21 +71,21 @@ function __construct($debtPrincipal,
70
71
* @param $debtPrincipal
71
72
*/
72
73
private function setDebtPrincipalWithoutRecalculation ($ debtPrincipal ) {
73
- $ this ->setProperty ("debtPrincipal " , $ debtPrincipal , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
74
+ $ this ->setProperty ("debtPrincipal " , $ debtPrincipal , Lambdas:: checkIfPositive () );
74
75
}
75
76
76
77
/**
77
78
* @param $debtNoOfCompoundingPeriods
78
79
*/
79
80
private function setDebtNoOfCompoundingPeriodsWithoutRecalculation ($ debtNoOfCompoundingPeriods ) {
80
- $ this ->setProperty ("debtNoOfCompoundingPeriods " , $ debtNoOfCompoundingPeriods , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
81
+ $ this ->setProperty ("debtNoOfCompoundingPeriods " , $ debtNoOfCompoundingPeriods , Lambdas:: checkIfPositive () );
81
82
}
82
83
83
84
/**
84
85
* @param $debtInterest
85
86
*/
86
87
private function setDebtInterestWithoutRecalculation ($ debtInterest ) {
87
- $ this ->setProperty ("debtInterest " , $ debtInterest , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
88
+ $ this ->setProperty ("debtInterest " , $ debtInterest , Lambdas:: checkIfPositive () );
88
89
}
89
90
90
91
/**
@@ -107,7 +108,7 @@ public function setDebtNoOfCompoundingPeriods($debtNoOfCompoundingPeriods) {
107
108
* @param $debtPeriodLength
108
109
*/
109
110
public function setDebtPeriodLength (TimeSpan $ debtPeriodLength ) {
110
- $ this ->setProperty ("debtPeriodLength " , $ debtPeriodLength , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
111
+ $ this ->setProperty ("debtPeriodLength " , $ debtPeriodLength , Lambdas:: checkIfPositive () );
111
112
}
112
113
113
114
/**
0 commit comments