| Total Complexity | 7 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 11 | class CountAtMost extends AbstractValidation |
||
| 12 | { |
||
| 13 | const MESSAGE = 'Expected count is at most: %s'; |
||
| 14 | |||
| 15 | public function __construct(private int $count, string $message = null) |
||
| 16 | { |
||
| 17 | parent::__construct($message ?? sprintf(self::MESSAGE, $this->count)); |
||
| 18 | } |
||
| 19 | |||
| 20 | protected function evaluate($input, array $context = []): bool |
||
| 43 | } |
||
| 44 | } |
||
| 45 |