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 ( a48bd8...83d092 )
by joseph
16:18 queued 18s
created

AbstractEntityConstraintValidator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 13
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getEntity() 0 8 2
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Validation\Constraints;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\EntityInterface;
6
use Symfony\Component\Validator\ConstraintValidator;
7
8
abstract class AbstractEntityConstraintValidator extends ConstraintValidator
9
{
10
    /**
11
     * @return EntityInterface
12
     */
13
    protected function getEntity(): EntityInterface
14
    {
15
        $entity = $this->context->getObject();
16
        if ($entity instanceof EntityInterface) {
17
            return $entity;
18
        }
19
        throw new \RuntimeException(
20
            'The object being validated is not an Entity, it is an instance of  ' . get_class($entity)
21
        );
22
    }
23
}
24