Passed
Push — dev ( f3475b...4f3a03 )
by Nico
29:49
created

MiningQueue::getId()   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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
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\OneToOne;
14
use Doctrine\ORM\Mapping\Table;
15
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...
16
use Stu\Orm\Repository\MiningQueueRepository;
17
18
#[Table(name: 'stu_mining_queue')]
19
#[Entity(repositoryClass: MiningQueueRepository::class)]
20
class MiningQueue implements MiningQueueInterface
21
{
22
    #[Id]
23
    #[Column(type: 'integer')]
24
    #[GeneratedValue(strategy: 'IDENTITY')]
25
    private int $id;
26
27
    #[Column(type: 'integer')]
28
    private int $ship_id;
29
30
    #[Column(type: 'integer')]
31
    private int $location_mining_id;
0 ignored issues
show
introduced by
The private property $location_mining_id is not used, and could be removed.
Loading history...
32
33
    #[ManyToOne(targetEntity: 'LocationMining')]
34
    #[JoinColumn(name: 'location_mining_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
35
    private LocationMiningInterface $locationMining;
0 ignored issues
show
introduced by
The private property $locationMining is not used, and could be removed.
Loading history...
36
37
    #[OneToOne(targetEntity: 'Ship')]
38
    #[JoinColumn(name: 'ship_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
39
    private ShipInterface $ship;
40
41
    #[Override]
42
    public function getId(): int
43
    {
44
        return $this->id;
45
    }
46
47
    #[Override]
48
    public function getShipId(): int
49
    {
50
        return $this->ship_id;
51
    }
52
53
    #[Override]
54
    public function setShip(ShipInterface $ship): MiningQueueInterface
55
    {
56
        $this->ship = $ship;
57
        return $this;
58
    }
59
60
    #[Override]
61
    public function getShip(): ShipInterface
62
    {
63
        return $this->ship;
64
    }
65
}
66