Passed
Push — master ( 77a570...adeb98 )
by Nico
26:43
created

ColonyShipQueue::setMode()   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 1
dl 0
loc 4
ccs 0
cts 3
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\Index;
12
use Doctrine\ORM\Mapping\JoinColumn;
13
use Doctrine\ORM\Mapping\ManyToOne;
14
use Doctrine\ORM\Mapping\OneToOne;
15
use Doctrine\ORM\Mapping\Table;
16
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...
17
use Stu\Orm\Repository\ColonyShipQueueRepository;
18
19
#[Table(name: 'stu_colonies_shipqueue')]
20
#[Index(name: 'colony_shipqueue_building_function_idx', columns: ['colony_id', 'building_function_id'])]
21
#[Index(name: 'colony_shipqueue_user_idx', columns: ['user_id'])]
22
#[Index(name: 'colony_shipqueue_finish_date_idx', columns: ['finish_date'])]
23
#[Entity(repositoryClass: ColonyShipQueueRepository::class)]
24
class ColonyShipQueue implements ColonyShipQueueInterface
25
{
26
    #[Id]
27
    #[Column(type: 'integer')]
28
    #[GeneratedValue(strategy: 'IDENTITY')]
29
    private int $id;
30
31
    #[Column(type: 'integer')]
32
    private int $colony_id = 0;
0 ignored issues
show
introduced by
The private property $colony_id is not used, and could be removed.
Loading history...
33
34
    #[Column(type: 'integer')]
35
    private int $user_id = 0;
36
37
    #[Column(type: 'integer')]
38
    private int $rump_id = 0;
39
40
    #[Column(type: 'integer')]
41
    private int $buildplan_id = 0;
0 ignored issues
show
introduced by
The private property $buildplan_id is not used, and could be removed.
Loading history...
42
43
    #[Column(type: 'integer')]
44
    private int $buildtime = 0;
45
46
    #[Column(type: 'integer')]
47
    private int $finish_date = 0;
48
49
    #[Column(type: 'integer')]
50
    private int $stop_date = 0;
51
52
    #[Column(type: 'smallint')]
53
    private int $building_function_id = 0;
54
55
    #[Column(type: 'integer', nullable: true)]
56
    private ?int $mode = null;
57
58
    #[Column(type: 'integer', nullable: true)]
59
    private ?int $ship_id = null;
0 ignored issues
show
introduced by
The private property $ship_id is not used, and could be removed.
Loading history...
60
61
    #[ManyToOne(targetEntity: 'ShipBuildplan')]
62
    #[JoinColumn(name: 'buildplan_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
63
    private ShipBuildplanInterface $shipBuildplan;
64
65
    #[ManyToOne(targetEntity: 'ShipRump')]
66
    #[JoinColumn(name: 'rump_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
67
    private ShipRumpInterface $shipRump;
68
69
    #[ManyToOne(targetEntity: 'Colony')]
70
    #[JoinColumn(name: 'colony_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
71
    private ColonyInterface $colony;
72
73
    #[OneToOne(targetEntity: 'Ship')]
74
    #[JoinColumn(name: 'ship_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
75
    private ?ShipInterface $ship = null;
76
77
    #[Override]
78
    public function getId(): int
79
    {
80
        return $this->id;
81
    }
82
83
    #[Override]
84
    public function getColony(): ColonyInterface
85
    {
86
        return $this->colony;
87
    }
88
89
    #[Override]
90
    public function setColony(ColonyInterface $colony): ColonyShipQueueInterface
91
    {
92
        $this->colony = $colony;
93
        return $this;
94
    }
95
96
    #[Override]
97
    public function getUserId(): int
98
    {
99
        return $this->user_id;
100
    }
101
102
    #[Override]
103
    public function setUserId(int $userId): ColonyShipQueueInterface
104
    {
105
        $this->user_id = $userId;
106
107
        return $this;
108
    }
109
110
    #[Override]
111
    public function getRumpId(): int
112
    {
113
        return $this->rump_id;
114
    }
115
116
    #[Override]
117
    public function setRumpId(int $shipRumpId): ColonyShipQueueInterface
118
    {
119
        $this->rump_id = $shipRumpId;
120
121
        return $this;
122
    }
123
124
    #[Override]
125
    public function getBuildtime(): int
126
    {
127
        return $this->buildtime;
128
    }
129
130
    #[Override]
131
    public function setBuildtime(int $buildtime): ColonyShipQueueInterface
132
    {
133
        $this->buildtime = $buildtime;
134
135
        return $this;
136
    }
137
138
    #[Override]
139
    public function getFinishDate(): int
140
    {
141
        return $this->finish_date;
142
    }
143
144
    #[Override]
145
    public function setFinishDate(int $finishDate): ColonyShipQueueInterface
146
    {
147
        $this->finish_date = $finishDate;
148
149
        return $this;
150
    }
151
152
    #[Override]
153
    public function getStopDate(): int
154
    {
155
        return $this->stop_date;
156
    }
157
158
    #[Override]
159
    public function setStopDate(int $stopDate): ColonyShipQueueInterface
160
    {
161
        $this->stop_date = $stopDate;
162
163
        return $this;
164
    }
165
166
    #[Override]
167
    public function getBuildingFunctionId(): int
168
    {
169
        return $this->building_function_id;
170
    }
171
172
    #[Override]
173
    public function setBuildingFunctionId(int $buildingFunctionId): ColonyShipQueueInterface
174
    {
175
        $this->building_function_id = $buildingFunctionId;
176
177
        return $this;
178
    }
179
180
    #[Override]
181
    public function getRump(): ShipRumpInterface
182
    {
183
        return $this->shipRump;
184
    }
185
186
    #[Override]
187
    public function setRump(ShipRumpInterface $shipRump): ColonyShipQueueInterface
188
    {
189
        $this->shipRump = $shipRump;
190
191
        return $this;
192
    }
193
194
    #[Override]
195
    public function getShipBuildplan(): ShipBuildplanInterface
196
    {
197
        return $this->shipBuildplan;
198
    }
199
200
    #[Override]
201
    public function setShipBuildplan(ShipBuildplanInterface $shipBuildplan): ColonyShipQueueInterface
202
    {
203
        $this->shipBuildplan = $shipBuildplan;
204
205
        return $this;
206
    }
207
208
209
    public function getMode(): ?int
210
    {
211
        return $this->mode;
212
    }
213
214
    public function setMode(?int $mode): ColonyShipQueueInterface
215
    {
216
        $this->mode = $mode;
217
        return $this;
218
    }
219
220
    public function getShip(): ?ShipInterface
221
    {
222
        return $this->ship;
223
    }
224
225
    public function setShip(?ShipInterface $ship): ColonyShipQueueInterface
226
    {
227
        $this->ship = $ship;
228
        return $this;
229
    }
230
}
231