Passed
Pull Request — master (#2161)
by Janko
25:16 queued 15:11
created

PirateRound::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
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\Common\Collections\ArrayCollection;
8
use Doctrine\Common\Collections\Collection;
9
use Doctrine\ORM\Mapping\Column;
10
use Doctrine\ORM\Mapping\Entity;
11
use Doctrine\ORM\Mapping\GeneratedValue;
12
use Doctrine\ORM\Mapping\Id;
13
use Doctrine\ORM\Mapping\OneToMany;
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\PirateRoundRepository;
17
18
#[Table(name: 'stu_pirate_round')]
19
#[Entity(repositoryClass: PirateRoundRepository::class)]
20
class PirateRound implements PirateRoundInterface
21
{
22
    #[Id]
23
    #[Column(type: 'integer')]
24
    #[GeneratedValue(strategy: 'IDENTITY')]
25
    private int $id;
26
27
    #[Column(type: 'integer')]
28
    private int $start = 0;
29
30
    #[Column(type: 'integer', nullable: true)]
31
    private ?int $end_time = null;
32
33
    #[Column(type: 'integer')]
34
    private int $max_prestige = 0;
35
36
    #[Column(type: 'integer')]
37
    private int $actual_prestige = 0;
38
39
    #[Column(type: 'integer', nullable: true)]
40
    private ?int $faction_winner = null;
41
42
    /**
43
     * @var ArrayCollection<int, UserPirateRoundInterface>
44
     */
45
    #[OneToMany(targetEntity: 'UserPirateRound', mappedBy: 'pirateRound')]
46
    private Collection $userPirateRounds;
47
48
    public function __construct()
49
    {
50
        $this->userPirateRounds = new ArrayCollection();
51
    }
52
53 1
    #[Override]
54
    public function getId(): int
55
    {
56 1
        return $this->id;
57
    }
58
59 1
    #[Override]
60
    public function getStart(): int
61
    {
62 1
        return $this->start;
63
    }
64
65
    #[Override]
66
    public function setStart(int $start): PirateRoundInterface
67
    {
68
        $this->start = $start;
69
        return $this;
70
    }
71
72 1
    #[Override]
73
    public function getEndTime(): ?int
74
    {
75 1
        return $this->end_time;
76
    }
77
78
    #[Override]
79
    public function setEndTime(?int $endTime): PirateRoundInterface
80
    {
81
        $this->end_time = $endTime;
82
        return $this;
83
    }
84
85 1
    #[Override]
86
    public function getMaxPrestige(): int
87
    {
88 1
        return $this->max_prestige;
89
    }
90
91
    #[Override]
92
    public function setMaxPrestige(int $maxPrestige): PirateRoundInterface
93
    {
94
        $this->max_prestige = $maxPrestige;
95
        return $this;
96
    }
97
98 1
    #[Override]
99
    public function getActualPrestige(): int
100
    {
101 1
        return $this->actual_prestige;
102
    }
103
104
    #[Override]
105
    public function setActualPrestige(int $actualPrestige): PirateRoundInterface
106
    {
107
        $this->actual_prestige = $actualPrestige;
108
        return $this;
109
    }
110
111 1
    #[Override]
112
    public function getFactionWinner(): ?int
113
    {
114 1
        return $this->faction_winner;
115
    }
116
117
    #[Override]
118
    public function setFactionWinner(?int $factionWinner): PirateRoundInterface
119
    {
120
        $this->faction_winner = $factionWinner;
121
        return $this;
122
    }
123
124
    #[Override]
125
    public function getUserPirateRounds(): Collection
126
    {
127
        return $this->userPirateRounds;
128
    }
129
}
130