Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function validate(mixed $input, array $context = []): Result |
||
23 | { |
||
24 | $errorReporting = new ErrorReporting; |
||
25 | foreach ($this->rules as $rule) { |
||
26 | $result = $rule->validate($input, $context); |
||
27 | if ($result->isOk()) { |
||
28 | return ErrorReporting::success(); |
||
29 | } |
||
30 | |||
31 | $errorReporting = $errorReporting->add($result); |
||
32 | } |
||
33 | |||
34 | return $errorReporting; |
||
35 | } |
||
37 |