GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 75bdf9...8faa57 )
by joseph
83:56 queued 81:04
created

ValidationException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2.0054

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 4
dl 0
loc 17
ccs 8
cts 9
cp 0.8889
crap 2.0054
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Exception;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\EntityInterface;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Testing\EntityDebugDumper;
7
use EdmondsCommerce\DoctrineStaticMeta\Exception\Traits\RelativePathTraceTrait;
8
use Symfony\Component\Validator\ConstraintViolationInterface;
9
use Symfony\Component\Validator\ConstraintViolationListInterface;
10
11
class ValidationException extends DoctrineStaticMetaException
12
{
13
    use RelativePathTraceTrait;
14
15
    protected $entity;
16
17
    protected $errors;
18
19
    /**
20
     * ValidationException constructor.
21
     *
22
     * @param ConstraintViolationListInterface|ConstraintViolationInterface[] $errors
23
     * @param EntityInterface                                                 $entity
24
     * @param int                                                             $code
25
     * @param \Exception|null                                                 $previous
26
     */
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
    }
45
46 1
    public function getInvalidEntity(): EntityInterface
47
    {
48 1
        return $this->entity;
49
    }
50
51 1
    public function getValidationErrors(): ConstraintViolationListInterface
52
    {
53 1
        return $this->errors;
54
    }
55
}
56