Grant   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 61
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getResource() 0 4 1
A setResource() 0 4 1
A getToken() 0 4 1
A setToken() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DataFlowServer\Authentication\Entities;
5
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity()
10
 * @ORM\Table(name="grants")
11
 */
12
class Grant
13
{
14
    /**
15
     * @ORM\Id()
16
     * @ORM\GeneratedValue()
17
     * @ORM\Column(type="integer")
18
     * @var integer
19
     */
20
    private $id;
21
    /**
22
     * @ORM\Column(type="string", nullable=false)
23
     * @var string
24
     */
25
    private $resource;
26
    /**
27
     * @ORM\ManyToOne(targetEntity="\SlayerBirden\DataFlowServer\Authentication\Entities\Token", inversedBy="grants")
28
     * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
29
     * @var Token
30
     */
31
    private $token;
32
33
    /**
34
     * @return int
35
     */
36 30
    public function getId(): int
37
    {
38 30
        return $this->id;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 136
    public function getResource(): string
45
    {
46 136
        return $this->resource;
47
    }
48
49
    /**
50
     * @param string $resource
51
     */
52 28
    public function setResource(string $resource): void
53
    {
54 28
        $this->resource = $resource;
55 28
    }
56
57
    /**
58
     * @return Token
59
     */
60 30
    public function getToken(): Token
61
    {
62 30
        return $this->token;
63
    }
64
65
    /**
66
     * @param Token $token
67
     */
68 24
    public function setToken(Token $token): void
69
    {
70 24
        $this->token = $token;
71 24
    }
72
}
73