| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 7 | public function execute($value, array $previousErrors, bool $preventDuplicate = false): void |
|
| 19 | { |
||
| 20 | 7 | $errors = []; |
|
| 21 | |||
| 22 | 7 | foreach ($this->rules as $rule) { |
|
| 23 | try { |
||
| 24 | 6 | $rule->validate($value); |
|
| 25 | 3 | return; |
|
| 26 | 6 | } catch (ValidationError $e) { |
|
| 27 | 6 | $errors[] = $e; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 4 | if (\count($errors) === 0) { |
|
| 32 | 1 | return; |
|
| 33 | } |
||
| 34 | |||
| 35 | 3 | throw ValidationError::fromValidationErrors(RuleName::ANY_OF, $value, $errors); |
|
| 36 | } |
||
| 38 |