Completed
Pull Request — master (#925)
by
unknown
01:37
created

RefreshTokenTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 48
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setAccessToken() 0 4 1
A getAccessToken() 0 4 1
A setExpiryDateTime() 0 4 1
A getExpiryDateTime() 0 4 1
1
<?php
2
/**
3
 * @author      Alex Bilbie <[email protected]>
4
 * @copyright   Copyright (c) Alex Bilbie
5
 * @license     http://mit-license.org/
6
 *
7
 * @link        https://github.com/thephpleague/oauth2-server
8
 */
9
10
namespace League\OAuth2\Server\Entities\Traits;
11
12
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
13
14
trait RefreshTokenTrait
15
{
16
    /**
17
     * @var AccessTokenEntityInterface
18
     */
19
    protected $accessToken;
20
21
    /**
22
     * @var \DateTime
23
     */
24
    protected $expiryDateTime;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 10
    public function setAccessToken(AccessTokenEntityInterface $accessToken)
30
    {
31 10
        $this->accessToken = $accessToken;
32 10
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 1
    public function getAccessToken()
38
    {
39 1
        return $this->accessToken;
40
    }
41
42
    /**
43
     * Get the token's expiry date time.
44
     *
45
     * @return \DateTime
46
     */
47
    public function getExpiryDateTime()
48
    {
49
        return $this->expiryDateTime;
50
    }
51
52
    /**
53
     * Set the date time when the token expires.
54
     *
55
     * @param \DateTime $dateTime
56
     */
57 10
    public function setExpiryDateTime(\DateTime $dateTime)
58
    {
59 10
        $this->expiryDateTime = $dateTime;
60 10
    }
61
}
62