| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 26 | 3 | public function __construct( |
|
| 27 | ConstraintViolationListInterface $errors, |
||
| 28 | EntityInterface $entity, |
||
| 29 | $code = 0, |
||
| 30 | \Exception $previous = null |
||
| 31 | ) { |
||
| 32 | 3 | $this->entity = $entity; |
|
| 33 | 3 | $this->errors = $errors; |
|
| 34 | |||
| 35 | 3 | $message = 'found '.$errors->count().' errors validating entity '.$entity->getShortName(); |
|
| 36 | 3 | foreach ($errors as $error) { |
|
| 37 | 1 | $message .= "\n".$error->getPropertyPath().': '.$error->getMessage(); |
|
| 38 | } |
||
| 39 | 3 | $message .= "\nEntity:".$entity->__toString(); |
|
| 40 | |||
| 41 | 3 | parent::__construct($message, $code, $previous); |
|
| 42 | 3 | } |
|
| 54 |