Total Complexity | 3 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
12 | class Choice extends AbstractRule |
||
13 | { |
||
14 | const MESSAGE = 'Invalid choice, accepted values: %s'; |
||
15 | |||
16 | public function __construct( |
||
17 | private array $list, |
||
18 | private bool $strict = true, |
||
19 | ?string $message = null, |
||
20 | int $stopOnFailure = StopSign::DONT_STOP |
||
21 | ) { |
||
22 | parent::__construct($message, $stopOnFailure); |
||
23 | } |
||
24 | |||
25 | public function isValid($input, array $context = []): bool |
||
28 | } |
||
29 | |||
30 | public function translatedMessage(): ?string |
||
35 |