RefreshTokenTrait::setExpiryDateTime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * @author      Alex Bilbie <[email protected]>
5
 * @copyright   Copyright (c) Alex Bilbie
6
 * @license     http://mit-license.org/
7
 *
8
 * @link        https://github.com/thephpleague/oauth2-server
9
 */
10
11
declare(strict_types=1);
12
13
namespace League\OAuth2\Server\Entities\Traits;
14
15
use DateTimeImmutable;
16
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
17
18
trait RefreshTokenTrait
19
{
20
    protected AccessTokenEntityInterface $accessToken;
21
22
    protected DateTimeImmutable $expiryDateTime;
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 19
    public function setAccessToken(AccessTokenEntityInterface $accessToken): void
28
    {
29 19
        $this->accessToken = $accessToken;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 1
    public function getAccessToken(): AccessTokenEntityInterface
36
    {
37 1
        return $this->accessToken;
38
    }
39
40
    /**
41
     * Get the token's expiry date time.
42
     */
43 5
    public function getExpiryDateTime(): DateTimeImmutable
44
    {
45 5
        return $this->expiryDateTime;
46
    }
47
48
    /**
49
     * Set the date time when the token expires.
50
     */
51 19
    public function setExpiryDateTime(DateTimeImmutable $dateTime): void
52
    {
53 19
        $this->expiryDateTime = $dateTime;
54
    }
55
}
56