Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 93.75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class Required implements RuleInterface |
||
19 | { |
||
20 | use Request; |
||
21 | |||
22 | private ?string $message; |
||
23 | |||
24 | 16 | public function __construct(?string $message = null) |
|
25 | { |
||
26 | 16 | $this->message = $message ?? 'Обязательно для заполнения, или выбора'; |
|
27 | } |
||
28 | |||
29 | |||
30 | /** |
||
31 | * @psalm-suppress PossiblyNullReference |
||
32 | * @param Ruleable&Element $element |
||
33 | * @return bool |
||
34 | */ |
||
35 | 10 | public function validate(Ruleable $element): bool |
|
48 | } |
||
49 | |||
50 | |||
51 | /** |
||
52 | * @param mixed $value |
||
53 | * @return bool |
||
54 | */ |
||
55 | 14 | private function check(mixed $value): bool |
|
61 | } |
||
62 | } |
||
63 |