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
Pull Request — master (#57)
by joseph
16:59
created

ValidationException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 42
ccs 13
cts 13
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 2
A getValidationErrors() 0 3 1
A getInvalidEntity() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Exception;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\EntityInterface;
6
use EdmondsCommerce\DoctrineStaticMeta\Exception\Traits\RelativePathTraceTrait;
7
use Symfony\Component\Validator\ConstraintViolationInterface;
8
use Symfony\Component\Validator\ConstraintViolationListInterface;
9
10
class ValidationException extends DoctrineStaticMetaException
11
{
12
    use RelativePathTraceTrait;
13
14
    protected $entity;
15
16
    protected $errors;
17
18
    /**
19
     * ValidationException constructor.
20
     *
21
     * @param ConstraintViolationListInterface|ConstraintViolationInterface[] $errors
22
     * @param EntityInterface                                                 $entity
23
     * @param int                                                             $code
24
     * @param \Exception|null                                                 $previous
25
     */
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
    }
43
44 1
    public function getInvalidEntity(): EntityInterface
45
    {
46 1
        return $this->entity;
47
    }
48
49 1
    public function getValidationErrors(): ConstraintViolationListInterface
50
    {
51 1
        return $this->errors;
52
    }
53
}
54