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

Buoy::setSystemMap()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
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\BuoyRepository;
16
17
#[Table(name: 'stu_buoy')]
18
#[Entity(repositoryClass: BuoyRepository::class)]
19
class Buoy implements BuoyInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'integer')]
27
    private int $user_id;
28
29
    #[Column(type: 'text')]
30
    private string $text;
31
32
    #[Column(type: 'integer')]
33
    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...
34
35
    #[Column(type: 'integer', nullable: true)]
36
    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...
37
38
    #[Column(type: 'integer', nullable: true)]
39
    private ?int $sys_map_id = null;
0 ignored issues
show
introduced by
The private property $sys_map_id is not used, and could be removed.
Loading history...
40
41
    #[ManyToOne(targetEntity: 'Location')]
42
    #[JoinColumn(name: 'location_id', referencedColumnName: 'id')]
43
    private LocationInterface $location;
44
45
    #[ManyToOne(targetEntity: 'User')]
46
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
47
    private UserInterface $user;
48
49
    #[Override]
50
    public function getId(): int
51
    {
52
        return $this->id;
53
    }
54
55
    #[Override]
56
    public function getUserId(): int
57
    {
58
        return $this->user_id;
59
    }
60
61
    #[Override]
62
    public function setUserId(int $user_id): void
63
    {
64
        $this->user_id = $user_id;
65
    }
66
67
    #[Override]
68
    public function getText(): string
69
    {
70
        return $this->text;
71
    }
72
73
    #[Override]
74
    public function setText(string $text): void
75
    {
76
        $this->text = $text;
77
    }
78
79
    #[Override]
80
    public function getLocation(): LocationInterface
81
    {
82
        return $this->location;
83
    }
84
85
    #[Override]
86
    public function setLocation(LocationInterface $location): BuoyInterface
87
    {
88
        $this->location = $location;
89
90
        return $this;
91
    }
92
93
    #[Override]
94
    public function getUser(): UserInterface
95
    {
96
        return $this->user;
97
    }
98
99
    #[Override]
100
    public function setUser(UserInterface $user): void
101
    {
102
        $this->user = $user;
103
    }
104
}
105