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; |
||
14 | |||
15 | use DateTimeImmutable; |
||
16 | |||
17 | interface TokenInterface |
||
18 | { |
||
19 | /** |
||
20 | * Get the token's identifier. |
||
21 | * |
||
22 | * @return non-empty-string |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
23 | */ |
||
24 | public function getIdentifier(): string; |
||
25 | |||
26 | /** |
||
27 | * Set the token's identifier. |
||
28 | * |
||
29 | * @param non-empty-string $identifier |
||
0 ignored issues
–
show
|
|||
30 | */ |
||
31 | public function setIdentifier(string $identifier): void; |
||
32 | |||
33 | /** |
||
34 | * Get the token's expiry date time. |
||
35 | */ |
||
36 | public function getExpiryDateTime(): DateTimeImmutable; |
||
37 | |||
38 | /** |
||
39 | * Set the date time when the token expires. |
||
40 | */ |
||
41 | public function setExpiryDateTime(DateTimeImmutable $dateTime): void; |
||
42 | |||
43 | /** |
||
44 | * Set the identifier of the user associated with the token. |
||
45 | * |
||
46 | * @param non-empty-string $identifier |
||
0 ignored issues
–
show
|
|||
47 | */ |
||
48 | public function setUserIdentifier(string $identifier): void; |
||
49 | |||
50 | /** |
||
51 | * Get the token user's identifier. |
||
52 | * |
||
53 | * @return non-empty-string|null |
||
0 ignored issues
–
show
|
|||
54 | */ |
||
55 | public function getUserIdentifier(): string|null; |
||
56 | |||
57 | /** |
||
58 | * Get the client that the token was issued to. |
||
59 | */ |
||
60 | public function getClient(): ClientEntityInterface; |
||
61 | |||
62 | /** |
||
63 | * Set the client that the token was issued to. |
||
64 | */ |
||
65 | public function setClient(ClientEntityInterface $client): void; |
||
66 | |||
67 | /** |
||
68 | * Associate a scope with the token. |
||
69 | */ |
||
70 | public function addScope(ScopeEntityInterface $scope): void; |
||
71 | |||
72 | /** |
||
73 | * Return an array of scopes associated with the token. |
||
74 | * |
||
75 | * @return ScopeEntityInterface[] |
||
76 | */ |
||
77 | public function getScopes(): array; |
||
78 | } |
||
79 |