Passed
Push — master ( 50087e...da76b1 )
by Nico
13:40
created

UserReferer::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\Id;
10
use Doctrine\ORM\Mapping\GeneratedValue;
11
use Doctrine\ORM\Mapping\JoinColumn;
12
use Doctrine\ORM\Mapping\OneToOne;
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
16
#[Table(name: 'stu_user_referer')]
17
#[Entity(repositoryClass: 'Stu\Orm\Repository\UserRefererRepository')]
18
class UserReferer implements UserRefererInterface
19
{
20
    #[Id]
21
    #[Column(type: 'integer')]
22
    #[GeneratedValue(strategy: 'IDENTITY')]
23
    private int $id;
24
25
    #[OneToOne(targetEntity: 'User', inversedBy: 'referer')]
26
    #[JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
27
    private UserInterface $user;
28
29
    #[Column(type: 'text')]
30
    private string $referer;
31
32
    #[Override]
33
    public function getId(): int
34
    {
35
        return $this->id;
36
    }
37
38
    #[Override]
39
    public function getUser(): UserInterface
40
    {
41
        return $this->user;
42
    }
43
44
    #[Override]
45
    public function setUser(UserInterface $user): UserRefererInterface
46
    {
47
        $this->user = $user;
48
        return $this;
49
    }
50
51
    #[Override]
52
    public function getReferer(): string
53
    {
54
        return $this->referer;
55
    }
56
57
    #[Override]
58
    public function setReferer(string $referer): UserRefererInterface
59
    {
60
        $this->referer = $referer;
61
        return $this;
62
    }
63
}
64