| Total Complexity | 8 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class AtLeast extends Rule |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * The minimum required quantity of filled attributes to pass the validation. |
||
| 18 | * Defaults to 1. |
||
| 19 | */ |
||
| 20 | private int $min = 1; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * The list of required attributes that will be checked. |
||
| 24 | */ |
||
| 25 | private array $attributes = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * The list of alternative required attributes that will be checked. |
||
| 29 | */ |
||
| 30 | private array $alternativeAttributes = []; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Message to display in case of error |
||
| 34 | */ |
||
| 35 | private string $message = 'The model is not valid. Must have at least "{min}" filled attributes.'; |
||
| 36 | |||
| 37 | 6 | public function __construct(array $data) |
|
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | 6 | protected function validateValue($value, DataSetInterface $dataSet = null): Result |
|
| 79 |