Passed
Push — dev ( a8a00a...e9ca26 )
by Nico
41:15 queued 24:14
created

MapRegion::getLayers()   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\JoinColumn;
14
use Doctrine\ORM\Mapping\ManyToOne;
15
use Doctrine\ORM\Mapping\OneToMany;
16
use Doctrine\ORM\Mapping\Table;
17
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...
18
use Stu\Orm\Repository\MapRegionRepository;
19
20
#[Table(name: 'stu_map_regions')]
21
#[Entity(repositoryClass: MapRegionRepository::class)]
22
class MapRegion implements MapRegionInterface
23
{
24
    #[Id]
25
    #[Column(type: 'integer')]
26
    #[GeneratedValue(strategy: 'IDENTITY')]
27
    private int $id;
28
29
    #[Column(type: 'string')]
30
    private string $description = '';
31
32
    #[Column(type: 'integer', nullable: true)]
33
    private ?int $database_id = 0;
0 ignored issues
show
introduced by
The private property $database_id is not used, and could be removed.
Loading history...
34
35
    #[Column(type: 'string', nullable: true)]
36
    private ?string $layers = null;
37
38
    #[ManyToOne(targetEntity: 'DatabaseEntry')]
39
    #[JoinColumn(name: 'database_id', referencedColumnName: 'id')]
40
    private ?DatabaseEntryInterface $databaseEntry = null;
41
42
    /** @var ArrayCollection<int, AstronomicalEntryInterface> */
43
    #[OneToMany(targetEntity: 'AstronomicalEntry', mappedBy: 'region', indexBy: 'user_id', fetch: 'EXTRA_LAZY')]
44
    private Collection $astronomicalEntries;
45
46
    public function __construct()
47
    {
48
        $this->astronomicalEntries = new ArrayCollection();
49
    }
50
51 4
    #[Override]
52
    public function getId(): int
53
    {
54 4
        return $this->id;
55
    }
56
57 4
    #[Override]
58
    public function getDescription(): string
59
    {
60 4
        return $this->description;
61
    }
62
63
    #[Override]
64
    public function setDescription(string $description): MapRegionInterface
65
    {
66
        $this->description = $description;
67
68
        return $this;
69
    }
70
71 1
    #[Override]
72
    public function getDatabaseEntry(): ?DatabaseEntryInterface
73
    {
74 1
        return $this->databaseEntry;
75
    }
76
77
    #[Override]
78
    public function setDatabaseEntry(?DatabaseEntryInterface $databaseEntry): MapRegionInterface
79
    {
80
        $this->databaseEntry = $databaseEntry;
81
82
        return $this;
83
    }
84
85 1
    #[Override]
86
    public function getAstronomicalEntries(): Collection
87
    {
88 1
        return $this->astronomicalEntries;
89
    }
90
91 1
    #[Override]
92
    public function getLayers(): ?string
93
    {
94 1
        return $this->layers;
95
    }
96
97
    #[Override]
98
    public function setLayers(?string $layers): MapRegionInterface
99
    {
100
        $this->layers = $layers;
101
102
        return $this;
103
    }
104
}
105