Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | abstract class GroupRule implements SerializableRuleInterface, BeforeValidationInterface |
||
19 | { |
||
20 | use BeforeValidationTrait; |
||
21 | use RuleNameTrait; |
||
22 | |||
23 | 2 | public function __construct( |
|
24 | private string $message = 'This value is not a valid.', |
||
25 | private bool $skipOnEmpty = false, |
||
26 | private bool $skipOnError = false, |
||
27 | /** |
||
28 | * @var Closure(mixed, ValidationContext):bool|null |
||
29 | */ |
||
30 | private ?Closure $when = null, |
||
31 | ) { |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return string |
||
36 | */ |
||
37 | 4 | public function getMessage(): string |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * Return custom rules set |
||
44 | */ |
||
45 | abstract public function getRuleSet(): array; |
||
46 | |||
47 | 1 | public function getOptions(): array |
|
48 | { |
||
49 | 1 | return (new RulesDumper())->asArray($this->getRuleSet()); |
|
50 | } |
||
51 | |||
52 | 1 | public function getHandlerClassName(): string |
|
55 | } |
||
56 | } |
||
57 |