| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 33 | public static function assertValid(object $entity, ValidatorInterface $validator) : void |
||
| 34 | { |
||
| 35 | $violations = self::convertViolationsToArray($validator->validate($entity)); |
||
| 36 | if ([] === $violations) { |
||
| 37 | return; |
||
| 38 | } |
||
| 39 | |||
| 40 | throw new self('Invalid Entity ' . get_class($entity), [ |
||
| 41 | 'violations' => $violations, |
||
| 42 | ]); |
||
| 65 |