Total Complexity | 7 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | trait GuardTrait |
||
10 | { |
||
11 | /** |
||
12 | * @throws ValidationExceptionInterface |
||
13 | */ |
||
14 | protected function guardRule( |
||
15 | Rule $rule, |
||
16 | mixed $input, |
||
17 | array $context = [], |
||
18 | ValidationExceptionInterface | string | null $validationException = null |
||
19 | ): void { |
||
20 | $result = $rule->validate($input, $context); |
||
21 | $this->guardResult($result, $validationException); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @throws ValidationExceptionInterface |
||
26 | */ |
||
27 | protected function guardResult( |
||
41 | } |
||
42 | |||
43 | private function createValidationException( |
||
50 | } |
||
51 | } |
||
52 |