Test Failed
Push — master ( 87706c...9d01da )
by Nico
24:23 queued 16:28
created

TShipItem::getWebId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Module\Ship\Lib;
6
7
use Doctrine\ORM\Mapping\Column;
8
use Doctrine\ORM\Mapping\Entity;
9
use Doctrine\ORM\Mapping\Id;
10
use Stu\Module\PlayerSetting\Lib\UserEnum;
11
12
/**
13
 * @Entity
14
 */
15
class TShipItem implements TShipItemInterface
16
{
17
    /** @Id @Column(type="integer") * */
18
    private int $ship_id = 0;
19
20
    /** @Column(type="integer", nullable=true) * */
21
    private ?int $fleet_id = null;
22
23
    /** @Column(type="integer") * */
24
    private int $rump_id = 0;
25
26
    /** @Column(type="integer", nullable=true) * */
27
    private ?int $former_rump_id = null;
28
29
    /** @Column(type="integer", nullable=true) * */
30
    private ?int $warp_state = null;
31
32
    /** @Column(type="integer", nullable=true) * */
33
    private ?int $cloak_state = null;
34
35
    /** @Column(type="integer", nullable=true) * */
36
    private ?int $shield_state = null;
37
38
    /** @Column(type="integer", nullable=true) * */
39
    private ?int $uplink_state = null;
40
41
    /** @Column(type="boolean") * */
42
    private bool $is_destroyed = false;
43
44
    /** @Column(type="integer") * */
45
    private int $spacecraft_type = 0;
46
47
    /** @Column(type="string") * */
48
    private string $ship_name = '';
49
50
    /** @Column(type="integer") * */
51
    private int $hull = 0;
52
53
    /** @Column(type="integer") * */
54
    private int $max_hull = 0;
55
56
    /** @Column(type="integer") * */
57
    private int $shield = 0;
58
59
    /** @Column(type="integer", nullable=true) * */
60
    private ?int $web_id = null;
61
62
    /** @Column(type="integer", nullable=true) * */
63
    private ?int $web_finish_time = null;
64
65
    /** @Column(type="integer") * */
66
    private int $user_id = 0;
67
68
    /** @Column(type="string") * */
69
    private string $user_name = '';
70
71
    /** @Column(type="integer") * */
72
    private int $rump_category_id = 0;
73
74
    /** @Column(type="string") * */
75
    private string $rump_name = '';
76
77
    /** @Column(type="integer", nullable=true) * */
78
    private ?int $rump_role_id = null;
79
80
    /** @Column(type="boolean") * */
81
    private bool $has_logbook = false;
82
83
    public function getShipId(): int
84
    {
85
        return $this->ship_id;
86
    }
87
88
    public function getFleetId(): ?int
89
    {
90
        return $this->fleet_id;
91
    }
92
93
    public function getRumpId(): int
94
    {
95
        return $this->rump_id;
96
    }
97
98
    public function getFormerRumpId(): ?int
99
    {
100
        return $this->former_rump_id;
101
    }
102
103
    public function getWarpState(): int
104
    {
105
        return $this->warp_state ?? 0;
106
    }
107
108
    public function getCloakState(): int
109
    {
110
        return $this->cloak_state ?? 0;
111
    }
112
113
    public function getShieldState(): int
114
    {
115
        return $this->shield_state ?? 0;
116
    }
117
118
    public function getUplinkState(): int
119
    {
120
        return $this->uplink_state ?? 0;
121
    }
122
123
    public function isDestroyed(): bool
124
    {
125
        return $this->is_destroyed;
126
    }
127
128
    public function getSpacecraftType(): int
129
    {
130
        return $this->spacecraft_type;
131
    }
132
133
    public function getShipName(): string
134
    {
135
        return $this->ship_name;
136
    }
137
138
    public function getHull(): int
139
    {
140
        return $this->hull;
141
    }
142
143
    public function getMaxHull(): int
144
    {
145
        return $this->max_hull;
146
    }
147
148
    public function getShield(): int
149
    {
150
        return $this->shield;
151
    }
152
153
    public function getWebId(): ?int
154
    {
155
        return $this->web_id;
156
    }
157
158
    public function getWebFinishTime(): ?int
159
    {
160
        return $this->web_finish_time;
161
    }
162
163
    public function getUserId(): int
164
    {
165
        return $this->user_id;
166
    }
167
168
    public function isContactable(): bool
169
    {
170
        return $this->getUserId() != UserEnum::USER_NOONE;
171
    }
172
173
    public function getUserName(): string
174
    {
175
        return $this->user_name;
176
    }
177
178
    public function getRumpCategoryId(): int
179
    {
180
        return $this->rump_category_id;
181
    }
182
183
    public function getRumpName(): string
184
    {
185
        return $this->rump_name;
186
    }
187
188
    public function getRumpRoleId(): ?int
189
    {
190
        return $this->rump_role_id;
191
    }
192
193
    public function hasLogbook(): bool
194
    {
195
        return $this->has_logbook;
196
    }
197
}
198