Conditions | 6 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 8.6047 |
Changes | 0 |
1 | <?php |
||
39 | 6 | private function assertValidArguments($initial, $total) |
|
40 | { |
||
41 | 6 | if (!is_int($initial)) { |
|
42 | throw new InvalidArgumentException('The initial value should be an integer, instead got:' . gettype($initial)); |
||
43 | } |
||
44 | 6 | if ($initial < 0) { |
|
45 | throw new InvalidArgumentException('The initial value should be a positive integer'); |
||
46 | } |
||
47 | 6 | if (!is_int($total)) { |
|
48 | throw new InvalidArgumentException('The total value should be an integer, instead got:' . gettype($total)); |
||
49 | } |
||
50 | 6 | if ($total < 0) { |
|
51 | throw new InvalidArgumentException('The total value should be a positive integer'); |
||
52 | } |
||
53 | 6 | if ($total <= $initial) { |
|
54 | throw new InvalidArgumentException('The total value should be a greater than the initial value.'); |
||
55 | } |
||
56 | 6 | } |
|
57 | } |
||
58 |