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