Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | * Validates a single value for a set of custom rules. |
||
17 | */ |
||
18 | abstract class GroupRule implements ParametrizedRuleInterface, PreValidatableRuleInterface |
||
19 | { |
||
20 | use HandlerClassNameTrait; |
||
21 | use PreValidatableTrait; |
||
22 | use RuleNameTrait; |
||
23 | |||
24 | 1 | public function __construct( |
|
25 | private string $message = 'This value is not a valid.', |
||
26 | private bool $skipOnEmpty = false, |
||
27 | private bool $skipOnError = false, |
||
28 | private ?Closure $when = null, |
||
29 | ) { |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return string |
||
34 | */ |
||
35 | 4 | public function getMessage(): string |
|
36 | { |
||
37 | 4 | return $this->message; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Return custom rules set |
||
42 | */ |
||
43 | abstract public function getRuleSet(): array; |
||
44 | |||
45 | 1 | public function getOptions(): array |
|
46 | { |
||
50 |