Passed
Push — dev ( 4d4f83...13e3b4 )
by Janko
20:05
created

UserReferer   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 24
c 1
b 0
f 0
dl 0
loc 46
ccs 0
cts 12
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setReferer() 0 5 1
A getReferer() 0 4 1
A getId() 0 4 1
A getUserRegistration() 0 4 1
A setUserRegistration() 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\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: 'UserRegistration', inversedBy: 'referer')]
26
    #[JoinColumn(name: 'user_id', referencedColumnName: 'user_id', nullable: false, onDelete: 'CASCADE')]
27
    private UserRegistrationInterface $userRegistration;
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 getUserRegistration(): UserRegistrationInterface
40
    {
41
        return $this->userRegistration;
42
    }
43
44
    #[Override]
45
    public function setUserRegistration(UserRegistrationInterface $registration): UserRefererInterface
46
    {
47
        $this->userRegistration = $registration;
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