Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function validate(mixed $value, object $rule, ValidationContext $context): Result |
||
15 | { |
||
16 | if (!$rule instanceof NotNull) { |
||
17 | throw new UnexpectedRuleException(NotNull::class, $rule); |
||
18 | } |
||
19 | |||
20 | $result = new Result(); |
||
21 | |||
22 | if ($value === null) { |
||
23 | $result->addError('Values must not be null.'); |
||
24 | } |
||
25 | |||
26 | return $result; |
||
27 | } |
||
29 |