Token   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 98
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 8
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 98
ccs 20
cts 20
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setAccessToken() 0 6 1
A getAccessToken() 0 4 1
A setRefreshToken() 0 6 1
A getRefreshToken() 0 4 1
A setExpiresAt() 0 6 1
A getExpiresAt() 0 4 1
A setAccountId() 0 6 1
A getAccountId() 0 4 1
1
<?php
2
3
namespace Mechpave\ImgurClient\Entity;
4
5
/**
6
 * Class Token
7
 * @package Mechpave\ImgurClient\Entity
8
 */
9
class Token implements TokenInterface
10
{
11
    /**
12
     * Access token
13
     * @var string
14
     */
15
    protected $accessToken;
16
17
    /**
18
     * Refresh token
19
     * @var string
20
     */
21
    protected $refreshToken;
22
23
    /**
24
     * Timestamp of token expiration
25
     * @var int
26
     */
27
    protected $expiresAt;
28
29
    /**
30
     * Account Id, token is connected to
31
     * @var int
32
     */
33
    protected $accountId;
34
35
    /**
36
     * @inheritdoc
37
     */
38 4
    public function setAccessToken($accessToken)
39
    {
40 4
        $this->accessToken = $accessToken;
41
42 4
        return $this;
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 2
    public function getAccessToken()
49
    {
50 2
        return $this->accessToken;
51
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56 4
    public function setRefreshToken($refreshToken)
57
    {
58 4
        $this->refreshToken = $refreshToken;
59
60 4
        return $this;
61
    }
62
63
    /**
64
     * @inheritdoc
65
     */
66 2
    public function getRefreshToken()
67
    {
68 2
        return $this->refreshToken;
69
    }
70
71
    /**
72
     * @inheritdoc
73
     */
74 3
    public function setExpiresAt($timestamp)
75
    {
76 3
        $this->expiresAt = $timestamp;
77
78 3
        return $this;
79
    }
80
81
    /**
82
     * @inheritdoc
83
     */
84 3
    public function getExpiresAt()
85
    {
86 3
        return $this->expiresAt;
87
    }
88
89
    /**
90
     * @inheritdoc
91
     */
92 1
    public function setAccountId($accountId)
93
    {
94 1
        $this->accountId = $accountId;
95
96 1
        return $this;
97
    }
98
99
    /**
100
     * @inheritdoc
101
     */
102 1
    public function getAccountId()
103
    {
104 1
        return $this->accountId;
105
    }
106
}