Passed
Push — master ( 1d5530...fba2a1 )
by Nico
56:37 queued 25:57
created

TachyonScan::getStarsystemMap()   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\TachyonScanRepository;
17
18
#[Table(name: 'stu_tachyon_scan')]
19
#[Index(name: 'tachyon_scan_user_idx', columns: ['user_id'])]
20
#[Entity(repositoryClass: TachyonScanRepository::class)]
21
class TachyonScan implements TachyonScanInterface
22
{
23
    #[Id]
24
    #[Column(type: 'integer')]
25
    #[GeneratedValue(strategy: 'IDENTITY')]
26
    private int $id;
27
28
    #[Column(type: 'integer')]
29
    private int $user_id = 0;
30
31
    #[Column(type: 'integer')]
32
    private int $scan_time = 0;
33
34
    #[Column(type: 'integer')]
35
    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...
36
37
    #[ManyToOne(targetEntity: 'User')]
38
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
39
    private UserInterface $user;
40
41
    #[ManyToOne(targetEntity: 'Location')]
42
    #[JoinColumn(name: 'location_id', referencedColumnName: 'id')]
43
    private LocationInterface $location;
44
45
    #[Override]
46
    public function getId(): int
47
    {
48
        return $this->id;
49
    }
50
51
    #[Override]
52
    public function getUserId(): int
53
    {
54
        return $this->user_id;
55
    }
56
57
    #[Override]
58
    public function getUser(): UserInterface
59
    {
60
        return $this->user;
61
    }
62
63
    #[Override]
64
    public function setUser(UserInterface $user): TachyonScanInterface
65
    {
66
        $this->user = $user;
67
        return $this;
68
    }
69
70
    #[Override]
71
    public function getScanTime(): int
72
    {
73
        return $this->scan_time;
74
    }
75
    #[Override]
76
    public function setScanTime(int $scanTime): TachyonScanInterface
77
    {
78
        $this->scan_time = $scanTime;
79
        return $this;
80
    }
81
82
    #[Override]
83
    public function getLocation(): LocationInterface
84
    {
85
        return $this->location;
86
    }
87
88
    #[Override]
89
    public function setLocation(LocationInterface $location): TachyonScanInterface
90
    {
91
        $this->location = $location;
92
93
        return $this;
94
    }
95
}
96