Conditions | 4 |
Paths | 4 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 4.5923 |
Changes | 0 |
1 | <?php |
||
45 | 17 | protected static function validate($limit, $isSupportQuery) |
|
46 | { |
||
47 | 17 | if (!ctype_digit("$limit")) { |
|
48 | throw new LimitParameterException('Limit must be integer'); |
||
49 | } |
||
50 | 17 | if ($limit < 1) { |
|
51 | throw new LimitParameterException('Limit must be positive integer'); |
||
52 | } |
||
53 | 17 | return $isSupportQuery ? 1 : ($limit + 1); |
|
54 | } |
||
55 | |||
96 |