33namespace FinanCalc \Calculators {
44
55 use DateTime ;
6+ use FinanCalc \Constants \Lambdas ;
67 use FinanCalc \Interfaces \Calculator \CalculatorAbstract ;
78 use FinanCalc \Utils \MathFuncs ;
89 use FinanCalc \Utils \Time \TimeSpan ;
@@ -70,21 +71,21 @@ function __construct($debtPrincipal,
7071 * @param $debtPrincipal
7172 */
7273 private function setDebtPrincipalWithoutRecalculation ($ debtPrincipal ) {
73- $ this ->setProperty ("debtPrincipal " , $ debtPrincipal , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
74+ $ this ->setProperty ("debtPrincipal " , $ debtPrincipal , Lambdas:: checkIfPositive () );
7475 }
7576
7677 /**
7778 * @param $debtNoOfCompoundingPeriods
7879 */
7980 private function setDebtNoOfCompoundingPeriodsWithoutRecalculation ($ debtNoOfCompoundingPeriods ) {
80- $ this ->setProperty ("debtNoOfCompoundingPeriods " , $ debtNoOfCompoundingPeriods , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
81+ $ this ->setProperty ("debtNoOfCompoundingPeriods " , $ debtNoOfCompoundingPeriods , Lambdas:: checkIfPositive () );
8182 }
8283
8384 /**
8485 * @param $debtInterest
8586 */
8687 private function setDebtInterestWithoutRecalculation ($ debtInterest ) {
87- $ this ->setProperty ("debtInterest " , $ debtInterest , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
88+ $ this ->setProperty ("debtInterest " , $ debtInterest , Lambdas:: checkIfPositive () );
8889 }
8990
9091 /**
@@ -107,7 +108,7 @@ public function setDebtNoOfCompoundingPeriods($debtNoOfCompoundingPeriods) {
107108 * @param $debtPeriodLength
108109 */
109110 public function setDebtPeriodLength (TimeSpan $ debtPeriodLength ) {
110- $ this ->setProperty ("debtPeriodLength " , $ debtPeriodLength , $ GLOBALS [ " FINANCALC_FUNC_CHECK_IF_POSITIVE " ] );
111+ $ this ->setProperty ("debtPeriodLength " , $ debtPeriodLength , Lambdas:: checkIfPositive () );
111112 }
112113
113114 /**
0 commit comments