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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 92.86%

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 43
ccs 13
cts 14
cp 0.9286
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValidationErrors() 0 3 1
A getInvalidEntity() 0 3 1
A __construct() 0 17 2
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