Completed
Pull Request — master (#887)
by
unknown
02:49
created

TokenEntityTrait::getExpiryDateTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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\ClientEntityInterface;
13
14
trait TokenEntityTrait
15
{
16
    use ScopeEntityTrait;
17
18
    /**
19
     * @var \DateTime
20
     */
21
    protected $expiryDateTime;
22
23
    /**
24
     * @var string|int|null
25
     */
26
    protected $userIdentifier;
27
28
    /**
29
     * @var ClientEntityInterface
30
     */
31
    protected $client;
32
33
    /**
34
     * Get the token's expiry date time.
35
     *
36
     * @return \DateTime
37
     */
38 9
    public function getExpiryDateTime()
39
    {
40 9
        return $this->expiryDateTime;
41
    }
42
43
    /**
44
     * Set the date time when the token expires.
45
     *
46
     * @param \DateTime $dateTime
47
     */
48 30
    public function setExpiryDateTime(\DateTime $dateTime)
49
    {
50 30
        $this->expiryDateTime = $dateTime;
51 30
    }
52
53
    /**
54
     * Set the identifier of the user associated with the token.
55
     *
56
     * @param string|int|null $identifier The identifier of the user
57
     */
58 28
    public function setUserIdentifier($identifier)
59
    {
60 28
        $this->userIdentifier = $identifier;
61 28
    }
62
63
    /**
64
     * Get the token user's identifier.
65
     *
66
     * @return string|int|null
67
     */
68 12
    public function getUserIdentifier()
69
    {
70 12
        return $this->userIdentifier;
71
    }
72
73
    /**
74
     * Get the client that the token was issued to.
75
     *
76
     * @return ClientEntityInterface
77
     */
78 12
    public function getClient()
79
    {
80 12
        return $this->client;
81
    }
82
83
    /**
84
     * Set the client that the token was issued to.
85
     *
86
     * @param ClientEntityInterface $client
87
     */
88 30
    public function setClient(ClientEntityInterface $client)
89
    {
90 30
        $this->client = $client;
91 30
    }
92
}
93