| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 12 | public function inspect($value): ValidationReportInterface |
|
| 23 | { |
||
| 24 | 12 | $builder = new ValidationReportBuilder(); |
|
| 25 | |||
| 26 | 12 | foreach ($this->validatables as $validatable) { |
|
| 27 | 12 | if (!$validatable->validate($value)) { |
|
| 28 | 6 | $builder->withRuleViolation($validatable->getName()); |
|
| 29 | 6 | $status = false; |
|
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | 12 | $builder->withValidationStatus($status ?? true); |
|
| 34 | |||
| 35 | 12 | return $builder->build(); |
|
| 36 | } |
||
| 43 |