1 | <?php |
||
24 | abstract class Token implements \JsonSerializable, ContainsRecordedMessages, DomainObject |
||
25 | { |
||
26 | use PrivateMessageRecorderCapabilities; |
||
27 | |||
28 | /** |
||
29 | * @var \DateTimeImmutable|null |
||
30 | */ |
||
31 | protected $expiresAt = null; |
||
32 | |||
33 | /** |
||
34 | * @var ResourceOwnerId|null |
||
35 | */ |
||
36 | protected $resourceOwnerId = null; |
||
37 | |||
38 | /** |
||
39 | * @var ClientId|null |
||
40 | */ |
||
41 | protected $clientId = null; |
||
42 | |||
43 | /** |
||
44 | * @var DataBag |
||
45 | */ |
||
46 | protected $parameters; |
||
47 | |||
48 | /** |
||
49 | * @var DataBag |
||
50 | */ |
||
51 | protected $metadatas; |
||
52 | |||
53 | /** |
||
54 | * @var bool |
||
55 | */ |
||
56 | protected $revoked = false; |
||
57 | |||
58 | /** |
||
59 | * @var null|ResourceServerId |
||
60 | */ |
||
61 | protected $resourceServerId = null; |
||
62 | |||
63 | /** |
||
64 | * Token constructor. |
||
65 | */ |
||
66 | protected function __construct() |
||
71 | |||
72 | /** |
||
73 | * @return TokenId |
||
74 | */ |
||
75 | abstract public function getTokenId(): TokenId; |
||
76 | |||
77 | /** |
||
78 | * @return ResourceOwnerId |
||
79 | */ |
||
80 | public function getResourceOwnerId(): ResourceOwnerId |
||
84 | |||
85 | /** |
||
86 | * @return \DateTimeImmutable |
||
87 | */ |
||
88 | public function getExpiresAt(): \DateTimeImmutable |
||
92 | |||
93 | /** |
||
94 | * @return bool |
||
95 | */ |
||
96 | public function hasExpired(): bool |
||
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | public function getExpiresIn(): int |
||
113 | |||
114 | /** |
||
115 | * @return ClientId |
||
116 | */ |
||
117 | public function getClientId(): ClientId |
||
121 | |||
122 | /** |
||
123 | * @return DataBag |
||
124 | */ |
||
125 | public function getParameter(): DataBag |
||
129 | |||
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function isRevoked(): bool |
||
137 | |||
138 | /** |
||
139 | * @return DataBag |
||
140 | */ |
||
141 | public function getMetadata(): DataBag |
||
145 | |||
146 | /** |
||
147 | * @return null|ResourceServerId |
||
148 | */ |
||
149 | public function getResourceServerId(): ? ResourceServerId |
||
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | public function jsonSerialize() |
||
174 | } |
||
175 |