55namespace League \Bundle \OAuth2ServerBundle \Manager \InMemory ;
66
77use League \Bundle \OAuth2ServerBundle \Manager \AccessTokenManagerInterface ;
8- use League \Bundle \OAuth2ServerBundle \Model \AccessToken ;
8+ use League \Bundle \OAuth2ServerBundle \Model \AccessTokenInterface ;
99
1010final class AccessTokenManager implements AccessTokenManagerInterface
1111{
1212 /**
13- * @var array<string, AccessToken >
13+ * @var array<string, AccessTokenInterface >
1414 */
1515 private $ accessTokens = [];
1616
@@ -25,7 +25,7 @@ public function __construct(bool $persistAccessToken)
2525 /**
2626 * @psalm-mutation-free
2727 */
28- public function find (string $ identifier ): ?AccessToken
28+ public function find (string $ identifier ): ?AccessTokenInterface
2929 {
3030 if (!$ this ->persistAccessToken ) {
3131 return null ;
@@ -34,7 +34,7 @@ public function find(string $identifier): ?AccessToken
3434 return $ this ->accessTokens [$ identifier ] ?? null ;
3535 }
3636
37- public function save (AccessToken $ accessToken ): void
37+ public function save (AccessTokenInterface $ accessToken ): void
3838 {
3939 if (!$ this ->persistAccessToken ) {
4040 return ;
@@ -52,7 +52,7 @@ public function clearExpired(): int
5252 $ count = \count ($ this ->accessTokens );
5353
5454 $ now = new \DateTimeImmutable ();
55- $ this ->accessTokens = array_filter ($ this ->accessTokens , static function (AccessToken $ accessToken ) use ($ now ): bool {
55+ $ this ->accessTokens = array_filter ($ this ->accessTokens , static function (AccessTokenInterface $ accessToken ) use ($ now ): bool {
5656 return $ accessToken ->getExpiry () >= $ now ;
5757 });
5858
0 commit comments