Passed
Pull Request — master (#2161)
by Janko
25:16 queued 15:11
created

ColonyClassRestriction::getColonyClassId()   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', nullable: true)]
27
    private ?int $terraforming_id = null;
28
29
    #[Column(type: 'integer', nullable: true)]
30
    private ?int $building_id = null;
31
32
    #[ManyToOne(targetEntity: ColonyClass::class)]
33
    #[JoinColumn(name: 'colony_class_id', referencedColumnName: 'id', nullable: false)]
34
    private ColonyClassInterface $colonyClass;
35
36
    #[ManyToOne(targetEntity: Terraforming::class)]
37
    #[JoinColumn(name: 'terraforming_id', referencedColumnName: 'id', nullable: true)]
38
    private ?TerraformingInterface $terraforming = null;
39
40
    #[ManyToOne(targetEntity: Building::class)]
41
    #[JoinColumn(name: 'building_id', referencedColumnName: 'id', nullable: true)]
42
    private ?BuildingInterface $building = null;
43
44
    #[Override]
45
    public function getId(): int
46
    {
47
        return $this->id;
48
    }
49
50
    #[Override]
51
    public function getColonyClass(): ColonyClassInterface
52
    {
53
        return $this->colonyClass;
54
    }
55
56
    #[Override]
57
    public function getTerraformingId(): ?int
58
    {
59
        return $this->terraforming_id;
60
    }
61
62
    #[Override]
63
    public function setTerraformingId(?int $terraformingId): ColonyClassRestrictionInterface
64
    {
65
        $this->terraforming_id = $terraformingId;
66
        return $this;
67
    }
68
69
    #[Override]
70
    public function getTerraforming(): ?TerraformingInterface
71
    {
72
        return $this->terraforming;
73
    }
74
75
    #[Override]
76
    public function getBuildingId(): ?int
77
    {
78
        return $this->building_id;
79
    }
80
81
    #[Override]
82
    public function setBuildingId(?int $buildingId): ColonyClassRestrictionInterface
83
    {
84
        $this->building_id = $buildingId;
85
        return $this;
86
    }
87
88
    #[Override]
89
    public function getBuilding(): ?BuildingInterface
90
    {
91
        return $this->building;
92
    }
93
}
94