Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | private static function validateMinValue($minValue) : int |
||
33 | { |
||
34 | // IFF a user chooses not to include $minValue, or passes null, mandate it returns to 0. |
||
35 | $minValue = $minValue ?: 0; |
||
36 | |||
37 | // Validate that the minimum value is positive. |
||
38 | if ($minValue < 0) { |
||
39 | throw new \InvalidArgumentException("{$minValue} was not greater or equal to zero"); |
||
40 | } |
||
41 | |||
42 | return $minValue; |
||
43 | } |
||
45 |