Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class IntegerRule extends NumericRule implements IntegerRuleInterface |
||
13 | { |
||
14 | /** |
||
15 | * @param string $name |
||
16 | */ |
||
17 | 57 | public function __construct(string $name) |
|
18 | { |
||
19 | 57 | Rule::__construct($name); |
|
20 | 57 | $this->check(new Check( |
|
21 | 57 | CheckName::INTEGER, |
|
22 | 57 | CheckErrorName::NOT_INTEGER, |
|
23 | 57 | fn ($value) => is_int($value), |
|
24 | 57 | [] |
|
25 | 57 | ), true); |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | * |
||
31 | * @return static |
||
32 | */ |
||
33 | 11 | public function even(): self |
|
39 | 11 | )); |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | * |
||
45 | * @return static |
||
46 | */ |
||
47 | 12 | public function odd(): self |
|
53 | 12 | )); |
|
54 | } |
||
56 |