Passed
Push — dev ( d91619...3d1f41 )
by Nico
14:25
created

AllianceSettings::getAlliance()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
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\AllianceSettingsRepository;
16
17
#[Table(name: 'stu_alliance_settings')]
18
#[Entity(repositoryClass: AllianceSettingsRepository::class)]
19
class AllianceSettings implements AllianceSettingsInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'integer')]
27
    private int $alliance_id;
28
29
    #[Column(type: 'string')]
30
    private string $setting = '';
31
32
    #[Column(type: 'string')]
33
    private string $value = '';
34
35
    #[ManyToOne(targetEntity: 'Alliance')]
36
    #[JoinColumn(name: 'alliance_id', referencedColumnName: 'id')]
37
    private AllianceInterface $alliance;
38
39
    #[Override]
40
    public function getId(): int
41
    {
42
        return $this->id;
43
    }
44
45
    #[Override]
46
    public function getAllianceId(): int
47
    {
48
        return $this->alliance_id;
49
    }
50
51
    #[Override]
52
    public function setAllianceId(int $allianceId): AllianceSettingsInterface
53
    {
54
        $this->alliance_id = $allianceId;
55
        return $this;
56
    }
57
58
    #[Override]
59
    public function getAlliance(): AllianceInterface
60
    {
61
        return $this->alliance;
62
    }
63
64
    #[Override]
65
    public function setAlliance(AllianceInterface $alliance): AllianceSettingsInterface
66
    {
67
        $this->alliance = $alliance;
68
        $this->alliance_id = $alliance->getId();
69
        return $this;
70
    }
71
72
    #[Override]
73
    public function getSetting(): string
74
    {
75
        return $this->setting;
76
    }
77
78
    #[Override]
79
    public function setSetting(string $setting): AllianceSettingsInterface
80
    {
81
        $this->setting = $setting;
82
        return $this;
83
    }
84
85
    #[Override]
86
    public function getValue(): string
87
    {
88
        return $this->value;
89
    }
90
91
    #[Override]
92
    public function setValue(string $value): AllianceSettingsInterface
93
    {
94
        $this->value = $value;
95
        return $this;
96
    }
97
}
98