Passed
Pull Request — master (#1846)
by Nico
32:16
created

FlightSignature::getToDirection()   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\Index;
12
use Doctrine\ORM\Mapping\JoinColumn;
13
use Doctrine\ORM\Mapping\ManyToOne;
14
use Doctrine\ORM\Mapping\Table;
15
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...
16
use Stu\Orm\Repository\FlightSignatureRepository;
17
18
#[Table(name: 'stu_flight_sig')]
19
#[Index(name: 'flight_sig_user_idx', columns: ['user_id'])]
20
#[Index(name: 'flight_sig_sensor_result_idx', columns: ['from_direction', 'to_direction', 'time'])]
21
#[Entity(repositoryClass: FlightSignatureRepository::class)]
22
class FlightSignature implements FlightSignatureInterface
23
{
24
    #[Id]
25
    #[Column(type: 'integer')]
26
    #[GeneratedValue(strategy: 'IDENTITY')]
27
    private int $id;
28
29
    #[Column(type: 'integer')]
30
    private int $user_id = 0;
31
32
    #[Column(type: 'integer')]
33
    private int $ship_id = 0;
34
35
    #[Column(type: 'integer')]
36
    private int $rump_id = 0;
0 ignored issues
show
introduced by
The private property $rump_id is not used, and could be removed.
Loading history...
37
38
    #[Column(type: 'integer')]
39
    private int $time = 0;
40
41
    #[Column(type: 'integer')]
42
    private int $location_id = 0;
0 ignored issues
show
introduced by
The private property $location_id is not used, and could be removed.
Loading history...
43
44
    #[Column(type: 'integer', nullable: true)]
45
    private ?int $map_id = null;
0 ignored issues
show
introduced by
The private property $map_id is not used, and could be removed.
Loading history...
46
47
    #[Column(type: 'integer', nullable: true)]
48
    private ?int $starsystem_map_id = null;
0 ignored issues
show
introduced by
The private property $starsystem_map_id is not used, and could be removed.
Loading history...
49
50
    #[Column(type: 'smallint', length: 1)]
51
    private int $from_direction = 0;
52
53
    #[Column(type: 'smallint', length: 1)]
54
    private int $to_direction = 0;
55
56
    #[Column(type: 'string')]
57
    private string $ship_name;
58
59
    #[Column(type: 'boolean')]
60
    private bool $is_cloaked = false;
61
62
    #[ManyToOne(targetEntity: 'ShipRump')]
63
    #[JoinColumn(name: 'rump_id', referencedColumnName: 'id')]
64
    private ShipRumpInterface $rump;
65
66
    #[ManyToOne(targetEntity: 'Location')]
67
    #[JoinColumn(name: 'location_id', referencedColumnName: 'id')]
68
    private LocationInterface $location;
69
70
    #[Override]
71
    public function getId(): int
72
    {
73
        return $this->id;
74
    }
75
76
    #[Override]
77
    public function setUserId(int $userId): FlightSignatureInterface
78
    {
79
        $this->user_id = $userId;
80
        return $this;
81
    }
82
83
    #[Override]
84
    public function getShipId(): int
85
    {
86
        return $this->ship_id;
87
    }
88
89
    #[Override]
90
    public function setShipId(int $shipId): FlightSignatureInterface
91
    {
92
        $this->ship_id = $shipId;
93
        return $this;
94
    }
95
96
    #[Override]
97
    public function getShipName(): string
98
    {
99
        return $this->ship_name;
100
    }
101
102
    #[Override]
103
    public function setShipName(string $name): FlightSignatureInterface
104
    {
105
        $this->ship_name = $name;
106
        return $this;
107
    }
108
109
    #[Override]
110
    public function isCloaked(): bool
111
    {
112
        return $this->is_cloaked;
113
    }
114
115
    #[Override]
116
    public function setIsCloaked(bool $isCloaked): FlightSignatureInterface
117
    {
118
        $this->is_cloaked = $isCloaked;
119
        return $this;
120
    }
121
122
    #[Override]
123
    public function getRump(): ShipRumpInterface
124
    {
125
        return $this->rump;
126
    }
127
128
    #[Override]
129
    public function setRump(ShipRumpInterface $shipRump): FlightSignatureInterface
130
    {
131
        $this->rump = $shipRump;
132
        return $this;
133
    }
134
135
    #[Override]
136
    public function getTime(): int
137
    {
138
        return $this->time;
139
    }
140
    #[Override]
141
    public function setTime(int $time): FlightSignatureInterface
142
    {
143
        $this->time = $time;
144
        return $this;
145
    }
146
147
    #[Override]
148
    public function getLocation(): LocationInterface
149
    {
150
        return $this->location;
151
    }
152
153
    #[Override]
154
    public function setLocation(LocationInterface $location): FlightSignatureInterface
155
    {
156
        $this->location = $location;
157
158
        return $this;
159
    }
160
161
    #[Override]
162
    public function getFromDirection(): int
163
    {
164
        return $this->from_direction;
165
    }
166
167
    #[Override]
168
    public function setFromDirection(int $direction): FlightSignatureInterface
169
    {
170
        $this->from_direction = $direction;
171
        return $this;
172
    }
173
174
    #[Override]
175
    public function getToDirection(): int
176
    {
177
        return $this->to_direction;
178
    }
179
180
    #[Override]
181
    public function setToDirection(int $direction): FlightSignatureInterface
182
    {
183
        $this->to_direction = $direction;
184
        return $this;
185
    }
186
}
187