Passed
Push — master ( 0a354e...300378 )
by Nico
37:07 queued 24:59
created

ColonyClassRestriction::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Orm\Entity;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\GeneratedValue;
10
use Doctrine\ORM\Mapping\Id;
11
use Doctrine\ORM\Mapping\JoinColumn;
12
use Doctrine\ORM\Mapping\ManyToOne;
13
use Doctrine\ORM\Mapping\Table;
14
use Override;
0 ignored issues
show
Bug introduced by
The type Override was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Stu\Orm\Repository\ColonyClassRestrictionRepository;
16
17
#[Table(name: 'stu_colony_class_restriction')]
18
#[Entity(repositoryClass: ColonyClassRestrictionRepository::class)]
19
class ColonyClassRestriction implements ColonyClassRestrictionInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'integer')]
27
    private int $colony_class_id;
28
29
    #[Column(type: 'integer', nullable: true)]
30
    private ?int $terraforming_id = null;
31
32
    #[Column(type: 'integer', nullable: true)]
33
    private ?int $building_id = null;
34
35
    #[ManyToOne(targetEntity: ColonyClass::class)]
36
    #[JoinColumn(name: 'colony_class_id', referencedColumnName: 'id', nullable: false)]
37
    private ColonyClassInterface $colonyClass;
38
39
    #[ManyToOne(targetEntity: Terraforming::class)]
40
    #[JoinColumn(name: 'terraforming_id', referencedColumnName: 'id', nullable: true)]
41
    private ?TerraformingInterface $terraforming = null;
42
43
    #[ManyToOne(targetEntity: Building::class)]
44
    #[JoinColumn(name: 'building_id', referencedColumnName: 'id', nullable: true)]
45
    private ?BuildingInterface $building = null;
46
47
    #[Override]
48
    public function getId(): int
49
    {
50
        return $this->id;
51
    }
52
53
    #[Override]
54
    public function getColonyClassId(): int
55
    {
56
        return $this->colony_class_id;
57
    }
58
59
    #[Override]
60
    public function setColonyClassId(int $colonyClassId): ColonyClassRestrictionInterface
61
    {
62
        $this->colony_class_id = $colonyClassId;
63
        return $this;
64
    }
65
66
    #[Override]
67
    public function getColonyClass(): ColonyClassInterface
68
    {
69
        return $this->colonyClass;
70
    }
71
72
    #[Override]
73
    public function getTerraformingId(): ?int
74
    {
75
        return $this->terraforming_id;
76
    }
77
78
    #[Override]
79
    public function setTerraformingId(?int $terraformingId): ColonyClassRestrictionInterface
80
    {
81
        $this->terraforming_id = $terraformingId;
82
        return $this;
83
    }
84
85
    #[Override]
86
    public function getTerraforming(): ?TerraformingInterface
87
    {
88
        return $this->terraforming;
89
    }
90
91
    #[Override]
92
    public function getBuildingId(): ?int
93
    {
94
        return $this->building_id;
95
    }
96
97
    #[Override]
98
    public function setBuildingId(?int $buildingId): ColonyClassRestrictionInterface
99
    {
100
        $this->building_id = $buildingId;
101
        return $this;
102
    }
103
104
    #[Override]
105
    public function getBuilding(): ?BuildingInterface
106
    {
107
        return $this->building;
108
    }
109
}