Passed
Pull Request — master (#2146)
by Nico
35:16 queued 24:41
created

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