Conditions | 2 |
Paths | 2 |
Total Lines | 6 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 22 | private function validatePositiveInteger($number) |
|
35 | { |
||
36 | 22 | $positiveInteger = filter_var($number, FILTER_VALIDATE_INT, array('options' => array('min_range' => 1))); |
|
37 | |||
38 | 22 | if ($positiveInteger === false) { |
|
39 | 12 | throw new \InvalidArgumentException('Invalid positive integer: ' . print_r($number, true)); |
|
40 | } |
||
52 |