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.

AbstractEntityConstraintValidator   A
last analyzed

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