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