Passed
Push — master ( 3ab1c5...c69ced )
by Derek Stephen
17:56 queued 16:05
created

PassportRole   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 21
dl 0
loc 58
ccs 16
cts 16
cp 1
rs 10
c 3
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setUserId() 0 3 1
A setApprovedById() 0 3 1
A getApprovedById() 0 3 1
A getRole() 0 3 1
A setEntityId() 0 3 1
A setRole() 0 3 1
A getUserId() 0 3 1
A getEntityId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Passport\Entity;
6
7
use Bone\BoneDoctrine\Traits\HasCreatedAtDate;
8
use Bone\BoneDoctrine\Traits\HasId;
9
use Doctrine\ORM\Mapping as ORM;
10
11
#[ORM\Entity]
12
#[ORM\HasLifecycleCallbacks]
13
class PassportRole
14
{
15
    use HasId;
16
17
    #[ORM\Column(type: 'integer')]
18
    private int $userId;
19
20
    #[ORM\ManyToOne(targetEntity: Role::class)]
21
    private Role $role;
22
23
    #[ORM\Column(type: 'integer', nullable: true)]
24
    private $entityId;
25
26
    #[ORM\Column(type: 'integer', nullable: true)]
27
    private ?int $approvedById = null;
28
29
    use HasCreatedAtDate;
30
31 1
    public function getUserId(): int
32
    {
33 1
        return $this->userId;
34
    }
35
36 2
    public function setUserId(int $userId): void
37
    {
38 2
        $this->userId = $userId;
39
    }
40
41 2
    public function getRole(): Role
42
    {
43 2
        return $this->role;
44
    }
45
46 2
    public function setRole(Role $role): void
47
    {
48 2
        $this->role = $role;
49
    }
50
51 2
    public function getEntityId(): ?int
52
    {
53 2
        return $this->entityId;
54
    }
55
56 2
    public function setEntityId(int $entityId): void
57
    {
58 2
        $this->entityId = $entityId;
59
    }
60
61 1
    public function getApprovedById(): ?int
62
    {
63 1
        return $this->approvedById;
64
    }
65
66 1
    public function setApprovedById(?int $approvedById): void
67
    {
68 1
        $this->approvedById = $approvedById;
69
    }
70
}
71