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

ValidatedEntityTrait::loadPropertyValidatorMetaData()   A

Complexity

Conditions 5
Paths 14

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 30

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 20
rs 9.4888
c 0
b 0
f 0
ccs 0
cts 13
cp 0
cc 5
nc 14
nop 1
crap 30

1 Method

Rating   Name   Duplication   Size   Complexity  
A ValidatedEntityTrait::getValidatorStaticMeta() 0 7 2
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Traits;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Interfaces\ValidatedEntityInterface;
6
use EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException;
7
use EdmondsCommerce\DoctrineStaticMeta\ValidatorStaticMeta;
8
use Symfony\Component\Validator\Mapping\ClassMetadata as ValidatorClassMetaData;
9
10
/**
11
 * @see ValidatedEntityInterface
12
 */
13
trait ValidatedEntityTrait
14
{
15
    /**
16
     * @var ValidatorStaticMeta|null
17
     */
18
    private static $validatorStaticMeta;
19
20
    /**
21
     * This method is called by the Symfony validation component when loading the meta data
22
     *
23
     * In this method, we pass around the meta data object and add data to it as required.
24
     *
25
     *
26
     *
27
     * @param ValidatorClassMetaData $metadata
28
     *
29
     * @throws DoctrineStaticMetaException
30
     */
31
    public static function loadValidatorMetaData(ValidatorClassMetaData $metadata): void
32
    {
33
        static::getValidatorStaticMeta()->addValidatorMetaData($metadata);
34
    }
35
36
37
    /**
38
     * Get an instance of the ValidatorStaticMeta object for this Entity
39
     *
40
     * @return ValidatorStaticMeta
41
     */
42
    private static function getValidatorStaticMeta(): ValidatorStaticMeta
43
    {
44
        if (null === self::$validatorStaticMeta) {
45
            self::$validatorStaticMeta = new ValidatorStaticMeta(self::getDoctrineStaticMeta());
46
        }
47
48
        return self::$validatorStaticMeta;
49
    }
50
}
51