1 | <?php |
||
15 | class AccessTokenService implements AccessTokenServiceInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var AccessTokenRepositoryInterface |
||
19 | */ |
||
20 | private $accessTokenRepository; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $accessTokenClass; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private $defaultExpirationDuration = '+1 month'; |
||
31 | |||
32 | /** |
||
33 | * @var AuthenticationManagerInterface |
||
34 | */ |
||
35 | private $authenticationManager; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $authenticationProviderKey; |
||
41 | |||
42 | 18 | public function __construct( |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 4 | public function findByToken(string $token): ?AccessToken |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 2 | public function createAccessToken(?string $username, ?string $password): AccessToken |
|
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | 2 | public function findUserByToken(string $token): ?UserInterface |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 6 | public function listByUser(UserInterface $user): array |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 2 | public function createAccessTokenForUser(UserInterface $user): AccessToken |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | 4 | public function cleanUpExpiredTokens(): int |
|
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 2 | public function remove(AccessToken $accessToken) |
|
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getDefaultExpirationDuration() |
||
139 | |||
140 | /** |
||
141 | * @param string $defaultExpirationDuration |
||
142 | */ |
||
143 | public function setDefaultExpirationDuration($defaultExpirationDuration) |
||
147 | } |
||
148 |