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.

DoctrineEntity::loadMetadata()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
declare(strict_types=1);
3
namespace Thunder\Platenum\Tests\Fake;
4
5
use Doctrine\ORM\Mapping\ClassMetadata;
6
use Thunder\Platenum\Enum\ConstantsEnumTrait;
7
8
final class DoctrineEntity
9
{
10
    private $id;
11
    private $intValue;
12
    private $stringValue;
13
    private $nullableValue;
14
15
    public function __construct(
16
        int $id,
17
        DoctrineIntEnum $int,
18
        DoctrineStringEnum $string,
19
        ?DoctrineStringEnum $nullableString = null
20
    ) {
21
        $this->id = $id;
22
        $this->intValue = $int;
23
        $this->stringValue = $string;
24
        $this->nullableValue = $nullableString;
25
    }
26
27
    public static function loadMetadata(ClassMetadata $metadata)
28
    {
29
        $metadata->setPrimaryTable(['name' => 'doctrine_entity']);
30
31
        $metadata->mapField(['id' => true, 'fieldName' => 'id', 'type' => 'integer']);
32
        $metadata->mapField(['fieldName' => 'intValue', 'columnName' => 'int_value', 'type' => 'intEnum']);
33
        $metadata->mapField(['fieldName' => 'stringValue', 'columnName' => 'string_value', 'type' => 'stringEnum']);
34
        $metadata->mapField(['fieldName' => 'nullableValue', 'columnName' => 'nullable_value', 'type' => 'stringEnum', 'nullable' => true]);
35
    }
36
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    public function getIntValue(): DoctrineIntEnum
43
    {
44
        return $this->intValue;
45
    }
46
47
    public function getStringValue(): DoctrineStringEnum
48
    {
49
        return $this->stringValue;
50
    }
51
52
    public function getNullableValue(): ?DoctrineStringEnum
53
    {
54
        return $this->nullableValue;
55
    }
56
}
57