| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class RuleWithBuiltInHandler implements RuleInterface, RuleHandlerInterface |
||
| 13 | { |
||
| 14 | public function validate(mixed $value, object $rule, ValidationContext $context): Result |
||
| 15 | { |
||
| 16 | $result = new Result(); |
||
| 17 | |||
| 18 | if ($value !== 42) { |
||
| 19 | $result->addError('Value must be 42.'); |
||
| 20 | } |
||
| 21 | |||
| 22 | return $result; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function getName(): string |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getHandler(): string|RuleHandlerInterface |
||
| 33 | } |
||
| 34 | } |
||
| 35 |