Completed
Push — master ( 2afc29...29656f )
by Philip
06:07
created

AccessToken   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 83.33%

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getToken() 0 4 1
A setToken() 0 4 1
A getExpiry() 0 4 1
A setExpiry() 0 4 1
getUser() 0 1 ?
setUser() 0 1 ?
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\Entity;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
/**
8
 * @author Philip Washington Sorst <[email protected]>
9
 */
10
abstract class AccessToken
11
{
12
    /**
13
     * @var int
14
     */
15
    private $id;
16
17
    /**
18
     * @var string
19
     */
20
    private $token;
21
22
    /**
23
     * @var \DateTime|null
24
     */
25
    private $expiry;
26
27
    /**
28
     * @return int
29
     */
30
    public function getId(): int
31
    {
32
        return $this->id;
33
    }
34
35
    /**
36
     * @return string
37
     */
38 50
    public function getToken()
39
    {
40 50
        return $this->token;
41
    }
42
43
    /**
44
     * @param string $token
45
     */
46 96
    public function setToken($token)
47
    {
48 96
        $this->token = $token;
49 96
    }
50
51
    /**
52
     * @return \DateTime|null
53
     */
54 50
    public function getExpiry()
55
    {
56 50
        return $this->expiry;
57
    }
58
59
    /**
60
     * @param \DateTime|null $expiry
61
     */
62 2
    public function setExpiry($expiry)
63
    {
64 2
        $this->expiry = $expiry;
65 2
    }
66
67
    /**
68
     * @return UserInterface
69
     */
70
    abstract public function getUser();
71
72
    /**
73
     * @param $user UserInterface
74
     */
75
    abstract public function setUser($user);
76
}
77