Total Complexity | 8 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
13 | class HasKey extends AbstractRule |
||
14 | { |
||
15 | const MESSAGE = 'Key not found: %s'; |
||
16 | |||
17 | public function __construct( |
||
18 | private string $key, |
||
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 |
||
44 | } |
||
45 | |||
46 | public function translatedMessage(): ?string |
||
51 |