Total Complexity | 2 |
Total Lines | 14 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
10 | class Exactly extends AbstractValidation |
||
11 | { |
||
12 | const MESSAGE = 'The value should be exacly `%s`'; |
||
13 | |||
14 | public function __construct(private mixed $value, ?string $message = null) |
||
15 | { |
||
16 | $this->message = $message ?? sprintf(self::MESSAGE, $this->value); |
||
17 | parent::__construct($message); |
||
18 | } |
||
19 | |||
20 | protected function evaluate($input, array $context = []): bool |
||
23 | } |
||
24 | } |
||
25 |