1 | <?php |
||
14 | class Helpers |
||
15 | { |
||
16 | /** |
||
17 | * @param $checkedVariable |
||
18 | * @param $nameOfTheExpectedClass |
||
19 | * @return bool |
||
20 | * @throws Exception |
||
21 | */ |
||
22 | public static function checkIfInstanceOfAClassOrThrowAnException($checkedVariable, $nameOfTheExpectedClass) |
||
31 | |||
32 | /** |
||
33 | * @param $leftOperand |
||
34 | * @param $rightOperand |
||
35 | * @param string $messageOnException |
||
36 | * @return bool |
||
37 | */ |
||
38 | public static function checkIfLeftOperandGreaterOrThrowAnException($leftOperand, $rightOperand, $messageOnException) |
||
46 | |||
47 | /** |
||
48 | * @param $checkedVariable |
||
49 | * @return bool |
||
50 | */ |
||
51 | public static function checkIfPositiveNumberOrThrowAnException($checkedVariable) |
||
59 | |||
60 | /** |
||
61 | * @param $checkedVariable |
||
62 | * @return bool |
||
63 | */ |
||
64 | public static function checkIfNotNegativeNumberOrThrowAnException($checkedVariable) |
||
72 | |||
73 | /** |
||
74 | * @param null|\FinanCalc\Constants\AnnuityPaymentTypes $checkedVariable |
||
75 | * @return bool |
||
76 | */ |
||
77 | public static function checkIfNotNull($checkedVariable) |
||
81 | |||
82 | /** |
||
83 | * @param $checkedVariable |
||
84 | * @return bool|null |
||
85 | */ |
||
86 | public static function checkIfPositiveNumber($checkedVariable) |
||
90 | |||
91 | /** |
||
92 | * @param $checkedVariable |
||
93 | * @return bool|null |
||
94 | */ |
||
95 | public static function checkIfZero($checkedVariable) |
||
99 | |||
100 | /** |
||
101 | * @param $checkedVariable |
||
102 | * @return bool |
||
103 | */ |
||
104 | public static function checkIfNotNegativeNumber($checkedVariable) |
||
108 | |||
109 | /** |
||
110 | * @param $checkedVariable |
||
111 | * @return bool|null |
||
112 | */ |
||
113 | public static function checkIfNegativeNumber($checkedVariable) |
||
117 | |||
118 | /** |
||
119 | * @param $checkedVariable |
||
120 | * @param integer $expectedResult |
||
121 | * @return bool|null |
||
122 | */ |
||
123 | public static function checkNumberRelativityToZero($checkedVariable, $expectedResult) |
||
131 | |||
132 | /** |
||
133 | * @param string $inputValue |
||
134 | * @return string |
||
135 | */ |
||
136 | public static function roundMoneyForDisplay($inputValue) |
||
140 | |||
141 | } |
||
142 | } |
||
143 |