| Total Complexity | 2 |
| Total Lines | 14 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 11 | class Generic extends AbstractRule |
||
| 12 | { |
||
| 13 | private Closure $rule; |
||
| 14 | |||
| 15 | public function __construct(callable $rule, ?string $message = 'Invalid input') |
||
| 16 | { |
||
| 17 | $this->rule = Closure::fromCallable($rule); |
||
| 18 | parent::__construct($message); |
||
| 19 | } |
||
| 20 | |||
| 21 | protected function evaluate($input, array $context = []): bool |
||
| 24 | } |
||
| 25 | } |
||
| 26 |