Total Complexity | 4 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | final class IntRule extends AbstractRule |
||
8 | { |
||
9 | 28 | public function name(): string |
|
12 | } |
||
13 | |||
14 | 34 | public function testConditions(string $parameterName, $value, bool $itemType = false): string |
|
15 | { |
||
16 | 34 | return sprintf(($itemType ? '' : '!is_null($%1$s) && ').'!(is_int($%1$s) || ctype_digit($%1$s))', $parameterName); |
|
17 | } |
||
18 | |||
19 | 28 | public function exceptionMessageOnTestFailure(string $parameterName, $value, bool $itemType = false): string |
|
22 | } |
||
23 | } |
||
24 |