Passed
Push — dev ( 7afdcb...e5a558 )
by Nico
14:32
created

DatabaseCategoryAward::getLayerId()   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\DatabaseCategoryAwardRepository;
16
17
#[Table(name: 'stu_database_category_awards')]
18
#[Entity(repositoryClass: DatabaseCategoryAwardRepository::class)]
19
class DatabaseCategoryAward implements DatabaseCategoryAwardInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'integer')]
27
    private int $category_id;
28
29
    #[Column(type: 'integer', nullable: true)]
30
    private ?int $layer_id = null;
31
32
    #[Column(type: 'integer', nullable: true)]
33
    private ?int $award_id = null;
34
35
    #[ManyToOne(targetEntity: DatabaseCategory::class)]
36
    #[JoinColumn(name: 'category_id', referencedColumnName: 'id')]
37
    private DatabaseCategoryInterface $category;
38
39
    #[ManyToOne(targetEntity: Award::class)]
40
    #[JoinColumn(name: 'award_id', referencedColumnName: 'id')]
41
    private ?AwardInterface $award = null;
42
43
    #[Override]
44
    public function getId(): int
45
    {
46
        return $this->id;
47
    }
48
49
    #[Override]
50
    public function setCategoryId(int $categoryId): DatabaseCategoryAwardInterface
51
    {
52
        $this->category_id = $categoryId;
53
        return $this;
54
    }
55
56
    #[Override]
57
    public function getCategoryId(): int
58
    {
59
        return $this->category_id;
60
    }
61
62
    #[Override]
63
    public function setLayerId(?int $layerId): DatabaseCategoryAwardInterface
64
    {
65
        $this->layer_id = $layerId;
66
        return $this;
67
    }
68
69
    #[Override]
70
    public function getLayerId(): ?int
71
    {
72
        return $this->layer_id;
73
    }
74
75
    #[Override]
76
    public function setAwardId(?int $awardId): DatabaseCategoryAwardInterface
77
    {
78
        $this->award_id = $awardId;
79
        return $this;
80
    }
81
82
    #[Override]
83
    public function getAwardId(): ?int
84
    {
85
        return $this->award_id;
86
    }
87
88
    #[Override]
89
    public function getCategory(): DatabaseCategoryInterface
90
    {
91
        return $this->category;
92
    }
93
94
    #[Override]
95
    public function getAward(): ?AwardInterface
96
    {
97
        return $this->award;
98
    }
99
}
100