| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 19 | final class Required extends Rule |
||
| 20 | { |
||
| 21 | public function __construct( |
||
| 22 | private string $message = 'Value cannot be blank.', |
||
| 23 | 17 | ?FormatterInterface $formatter = null, |
|
| 24 | bool $skipOnEmpty = false, |
||
| 25 | 17 | bool $skipOnError = false, |
|
| 26 | $when = null |
||
| 27 | ) { |
||
| 28 | 13 | parent::__construct(formatter: $formatter, skipOnEmpty: $skipOnEmpty, skipOnError: $skipOnError, when: $when); |
|
| 29 | } |
||
| 30 | 13 | ||
| 31 | protected function validateValue($value, ?ValidationContext $context = null): Result |
||
| 40 | } |
||
| 41 | 4 | ||
| 42 | 4 | public function getOptions(): array |
|
| 46 | ]); |
||
| 47 | } |
||
| 49 |