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

AllianceSettings   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 31
c 1
b 0
f 0
dl 0
loc 62
ccs 0
cts 17
cp 0
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getSetting() 0 4 1
A getAlliance() 0 4 1
A setValue() 0 5 1
A getValue() 0 4 1
A setAlliance() 0 5 1
A setSetting() 0 5 1
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\AllianceSettingsRepository;
16
17
#[Table(name: 'stu_alliance_settings')]
18
#[Entity(repositoryClass: AllianceSettingsRepository::class)]
19
class AllianceSettings implements AllianceSettingsInterface
20
{
21
    #[Id]
22
    #[Column(type: 'integer')]
23
    #[GeneratedValue(strategy: 'IDENTITY')]
24
    private int $id;
25
26
    #[Column(type: 'string')]
27
    private string $setting = '';
28
29
    #[Column(type: 'string')]
30
    private string $value = '';
31
32
    #[ManyToOne(targetEntity: 'Alliance')]
33
    #[JoinColumn(name: 'alliance_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
34
    private AllianceInterface $alliance;
35
36
    #[Override]
37
    public function getId(): int
38
    {
39
        return $this->id;
40
    }
41
42
    #[Override]
43
    public function getAlliance(): AllianceInterface
44
    {
45
        return $this->alliance;
46
    }
47
48
    #[Override]
49
    public function setAlliance(AllianceInterface $alliance): AllianceSettingsInterface
50
    {
51
        $this->alliance = $alliance;
52
        return $this;
53
    }
54
55
    #[Override]
56
    public function getSetting(): string
57
    {
58
        return $this->setting;
59
    }
60
61
    #[Override]
62
    public function setSetting(string $setting): AllianceSettingsInterface
63
    {
64
        $this->setting = $setting;
65
        return $this;
66
    }
67
68
    #[Override]
69
    public function getValue(): string
70
    {
71
        return $this->value;
72
    }
73
74
    #[Override]
75
    public function setValue(string $value): AllianceSettingsInterface
76
    {
77
        $this->value = $value;
78
        return $this;
79
    }
80
}
81