Passed
Push — master ( ace734...fbc010 )
by Alexandre
02:09
created

Token::getResourceOwnerIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Alexandre
5
 * Date: 10/03/2018
6
 * Time: 15:57
7
 */
8
9
namespace OAuth2\Credentials;
10
11
12
abstract class Token implements TokenInterface
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $token;
18
    /**
19
     * @var string[]
20
     */
21
    protected $scopes;
22
    /**
23
     * @var string
24
     */
25
    protected $clientIdentifier;
26
    /**
27
     * @var string|null
28
     */
29
    protected $resourceOwnerIdentifier;
30
    /**
31
     * @var \DateTimeInterface
32
     */
33
    protected $expiresAt;
34
    /**
35
     * @var string|null
36
     */
37
    protected $authorizationCode;
38
39
    public function __construct(string $token, array $scopes, string $clientIdentifier, ?string $resourceOwnerIdentifier,
40
                                \DateTimeInterface $expiresAt, ?string $authorizationCode = null)
41
    {
42
        $this->token = $token;
43
        $this->scopes = $scopes;
44
        $this->clientIdentifier = $clientIdentifier;
45
        $this->resourceOwnerIdentifier = $resourceOwnerIdentifier;
46
        $this->expiresAt = $expiresAt;
47
        $this->authorizationCode = $authorizationCode;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getToken(): string
54
    {
55
        return $this->token;
56
    }
57
58
    /**
59
     * @return string[]
60
     */
61
    public function getScopes(): array
62
    {
63
        return $this->scopes;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getClientIdentifier(): string
70
    {
71
        return $this->clientIdentifier;
72
    }
73
74
    /**
75
     * @return string|null
76
     */
77
    public function getResourceOwnerIdentifier(): ?string
78
    {
79
        return $this->resourceOwnerIdentifier;
80
    }
81
82
    /**
83
     * @return \DateTimeInterface
84
     */
85
    public function getExpiresAt(): \DateTimeInterface
86
    {
87
        return $this->expiresAt;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getAuthorizationCode(): ?string
94
    {
95
        return $this->authorizationCode;
96
    }
97
}