Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 62.5% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | abstract class NullableRule implements BaseRuleInterface |
||
10 | { |
||
11 | public const ERROR_NULL = 'null'; |
||
12 | |||
13 | /** |
||
14 | * @var bool |
||
15 | */ |
||
16 | protected bool $isNullable = false; |
||
17 | |||
18 | /** |
||
19 | * {@inheritDoc} |
||
20 | * |
||
21 | * @return static |
||
22 | */ |
||
23 | public function nullable(): self |
||
24 | { |
||
25 | $this->isNullable = true; |
||
26 | return $this; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * {@inheritDoc} |
||
31 | * |
||
32 | * @throws StopValidationException |
||
33 | */ |
||
34 | 38 | public function validate($value): void |
|
42 | } |
||
43 | } |
||
45 |