Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function validate(ReportInterface $report): void |
||
30 | { |
||
31 | $report->clearErrors(); |
||
32 | $report->setStatus(ReportInterface::STATUS_SUCCESS); |
||
33 | |||
34 | $constraintViolationList = $this->validator->validate($report, null, $this->validationGroups); // todo make this validation group a parameter |
||
35 | if ($constraintViolationList->count() > 0) { |
||
36 | foreach ($constraintViolationList as $constraintViolation) { |
||
37 | $error = $this->errorFactory->createFromConstraintViolation($constraintViolation); |
||
38 | $report->addError($error); |
||
39 | } |
||
40 | |||
41 | $report->setStatus(ReportInterface::STATUS_ERROR); |
||
42 | } |
||
45 |