Passed
Push — dev ( 97fee6...d16c83 )
by Nico
15:13
created

Faction::getPrimaryEffectCommodity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
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\FactionRepository;
16
17
#[Table(name: 'stu_factions')]
18
#[Entity(repositoryClass: FactionRepository::class)]
19
class Faction implements FactionInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'string')]
27
    private string $name = '';
28
29
    #[Column(type: 'text')]
30
    private string $description = '';
31
32
    #[Column(type: 'string')]
33
    private string $darker_color = '';
34
35
    #[Column(type: 'boolean')]
36
    private bool $chooseable = false;
37
38
    #[Column(type: 'integer')]
39
    private int $player_limit = 0;
40
41
    #[Column(type: 'integer')]
42
    private int $start_building_id = 0;
43
44
    #[Column(type: 'integer', nullable: true)]
45
    private ?int $start_research_id = null;
0 ignored issues
show
introduced by
The private property $start_research_id is not used, and could be removed.
Loading history...
46
47
    #[Column(type: 'integer', nullable: true)]
48
    private ?int $start_map_id = null;
0 ignored issues
show
introduced by
The private property $start_map_id is not used, and could be removed.
Loading history...
49
50
    #[Column(type: 'integer', nullable: true)]
51
    private ?int $close_combat_score = null;
52
53
    #[Column(type: 'integer', nullable: true)]
54
    private ?int $positive_effect_primary_commodity_id = null;
0 ignored issues
show
introduced by
The private property $positive_effect_primary_commodity_id is not used, and could be removed.
Loading history...
55
56
    #[Column(type: 'integer', nullable: true)]
57
    private ?int $positive_effect_secondary_commodity_id = null;
0 ignored issues
show
introduced by
The private property $positive_effect_secondary_commodity_id is not used, and could be removed.
Loading history...
58
59
    #[Column(type: 'text', nullable: true)]
60
    private ?string $welcome_message = '';
61
62
    //TODO survivor_rate to escape pods
63
    #[ManyToOne(targetEntity: 'Research')]
64
    #[JoinColumn(name: 'start_research_id', referencedColumnName: 'id')]
65
    private ?ResearchInterface $start_research = null;
66
67
    #[ManyToOne(targetEntity: 'Map')]
68
    #[JoinColumn(name: 'start_map_id', referencedColumnName: 'id')]
69
    private ?MapInterface $start_map = null;
70
71
    #[ManyToOne(targetEntity: Commodity::class)]
72
    #[JoinColumn(name: 'positive_effect_primary_commodity_id', referencedColumnName: 'id')]
73
    private ?CommodityInterface $primaryEffectCommodity = null;
74
75
    #[ManyToOne(targetEntity: Commodity::class)]
76
    #[JoinColumn(name: 'positive_effect_secondary_commodity_id', referencedColumnName: 'id')]
77
    private ?CommodityInterface $secondaryEffectCommodity = null;
78
79 3
    #[Override]
80
    public function getId(): int
81
    {
82 3
        return $this->id;
83
    }
84
85 1
    #[Override]
86
    public function getName(): string
87
    {
88 1
        return $this->name;
89
    }
90
91
    #[Override]
92
    public function setName(string $name): FactionInterface
93
    {
94
        $this->name = $name;
95
96
        return $this;
97
    }
98
99 1
    #[Override]
100
    public function getDescription(): string
101
    {
102 1
        return $this->description;
103
    }
104
105
    #[Override]
106
    public function setDescription(string $description): FactionInterface
107
    {
108
        $this->description = $description;
109
110
        return $this;
111
    }
112
113 1
    #[Override]
114
    public function getDarkerColor(): string
115
    {
116 1
        return $this->darker_color;
117
    }
118
119
    #[Override]
120
    public function setDarkerColor(string $darkerColor): FactionInterface
121
    {
122
        $this->darker_color = $darkerColor;
123
124
        return $this;
125
    }
126
127
    #[Override]
128
    public function getChooseable(): bool
129
    {
130
        return $this->chooseable;
131
    }
132
133
    #[Override]
134
    public function setChooseable(bool $chooseable): FactionInterface
135
    {
136
        $this->chooseable = $chooseable;
137
138
        return $this;
139
    }
140
141 1
    #[Override]
142
    public function getPlayerLimit(): int
143
    {
144 1
        return $this->player_limit;
145
    }
146
147
    #[Override]
148
    public function setPlayerLimit(int $playerLimit): FactionInterface
149
    {
150
        $this->player_limit = $playerLimit;
151
152
        return $this;
153
    }
154
155
    #[Override]
156
    public function getStartBuildingId(): int
157
    {
158
        return $this->start_building_id;
159
    }
160
161
    #[Override]
162
    public function setStartBuildingId(int $startBuildingId): FactionInterface
163
    {
164
        $this->start_building_id = $startBuildingId;
165
166
        return $this;
167
    }
168
169 6
    #[Override]
170
    public function getStartResearch(): ?ResearchInterface
171
    {
172 6
        return $this->start_research;
173
    }
174
175
    #[Override]
176
    public function setStartResearch(?ResearchInterface $start_research): FactionInterface
177
    {
178
        $this->start_research = $start_research;
179
        return $this;
180
    }
181
182
    #[Override]
183
    public function getStartMap(): ?MapInterface
184
    {
185
        return $this->start_map;
186
    }
187
188
    #[Override]
189
    public function setStartMap(?MapInterface $start_map): FactionInterface
190
    {
191
        $this->start_map = $start_map;
192
        return $this;
193
    }
194
195
    #[Override]
196
    public function getCloseCombatScore(): ?int
197
    {
198
        return $this->close_combat_score;
199
    }
200
201 6
    #[Override]
202
    public function getPrimaryEffectCommodity(): ?CommodityInterface
203
    {
204 6
        return $this->primaryEffectCommodity;
205
    }
206
207 6
    #[Override]
208
    public function getSecondaryEffectCommodity(): ?CommodityInterface
209
    {
210 6
        return $this->secondaryEffectCommodity;
211
    }
212
213 1
    #[Override]
214
    public function getWelcomeMessage(): ?string
215
    {
216 1
        return $this->welcome_message;
217
    }
218
219
    #[Override]
220
    public function setWelcomeMessage(string $welcome_message): FactionInterface
221
    {
222
        $this->welcome_message = $welcome_message;
223
224
        return $this;
225
    }
226
}
227