| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 12 | class CountExactly extends AbstractRule |
||
| 13 | { |
||
| 14 | const MESSAGE = 'Expected count is: %s'; |
||
| 15 | |||
| 16 | public function __construct( |
||
| 17 | private int $size, |
||
| 18 | ?string $message = null, |
||
| 19 | int $stopOnFailure = StopSign::DONT_STOP |
||
| 20 | ) { |
||
| 21 | parent::__construct($message, $stopOnFailure); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function isValid($input, array $context = []): bool |
||
| 40 | } |
||
| 41 | |||
| 42 | public function translatedMessage(): ?string |
||
| 45 | } |
||
| 46 | } |
||
| 47 |