Passed
Pull Request — master (#1887)
by Janko
53:41
created

LotteryWinnerBuildplan::getBuildplan()   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 0
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\LotteryWinnerBuildplanRepository;
16
17
#[Table(name: 'stu_lottery_buildplan')]
18
#[Entity(repositoryClass: LotteryWinnerBuildplanRepository::class)]
19
class LotteryWinnerBuildplan implements LotteryWinnerBuildplanInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'integer')]
27
    private int $buildplan_id;
0 ignored issues
show
introduced by
The private property $buildplan_id is not used, and could be removed.
Loading history...
28
29
    #[Column(type: 'integer')]
30
    private int $chance;
31
32
    #[ManyToOne(targetEntity: 'ShipBuildplan')]
33
    #[JoinColumn(name: 'buildplan_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
34
    private ShipBuildplanInterface $buildplan;
35
36
    public function getId(): int
37
    {
38
        return $this->id;
39
    }
40
41
    #[Override]
42
    public function getBuildplan(): ShipBuildplanInterface
43
    {
44
        return $this->buildplan;
45
    }
46
47
    #[Override]
48
    public function getChance(): int
49
    {
50
        return $this->chance;
51
    }
52
}
53