@@ -61,15 +61,12 @@ public function getTableName(): string
6161 public function getNewToken (
6262 OAuth2ClientEntityInterface $ clientEntity ,
6363 array $ scopes ,
64- $ userIdentifier = null ,
64+ ? string $ userIdentifier = null ,
6565 ?string $ authCodeId = null ,
6666 ?array $ requestedClaims = null ,
6767 ?string $ id = null ,
6868 ?DateTimeImmutable $ expiryDateTime = null ,
6969 ): AccessTokenEntityInterface {
70- if (!is_null ($ userIdentifier )) {
71- $ userIdentifier = (string )$ userIdentifier ;
72- }
7370 if (empty ($ userIdentifier )) {
7471 $ userIdentifier = null ;
7572 }
@@ -145,7 +142,7 @@ public function persistNewAccessToken(OAuth2AccessTokenEntityInterface $accessTo
145142 $ this ->helpers ->dateTime ()->getSecondsToExpirationTime (
146143 $ accessTokenEntity ->getExpiryDateTime ()->getTimestamp (),
147144 ),
148- $ this ->getCacheKey (( string ) $ accessTokenEntity ->getIdentifier ()),
145+ $ this ->getCacheKey ($ accessTokenEntity ->getIdentifier ()),
149146 );
150147 }
151148
@@ -184,7 +181,7 @@ public function findById(string $tokenId): ?AccessTokenEntity
184181 $ this ->helpers ->dateTime ()->getSecondsToExpirationTime (
185182 $ accessTokenEntity ->getExpiryDateTime ()->getTimestamp (),
186183 ),
187- $ this ->getCacheKey (( string ) $ accessTokenEntity ->getIdentifier ()),
184+ $ this ->getCacheKey ($ accessTokenEntity ->getIdentifier ()),
188185 );
189186
190187 return $ accessTokenEntity ;
@@ -195,7 +192,7 @@ public function findById(string $tokenId): ?AccessTokenEntity
195192 * @throws \JsonException
196193 * @throws \SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException
197194 */
198- public function revokeAccessToken ($ tokenId ): void
195+ public function revokeAccessToken (string $ tokenId ): void
199196 {
200197 $ accessToken = $ this ->findById ($ tokenId );
201198
@@ -227,7 +224,7 @@ public function revokeByAuthCodeId(string $authCodeId): void
227224 * {@inheritdoc}
228225 * @throws \SimpleSAML\Module\oidc\Server\Exceptions\OidcServerException
229226 */
230- public function isAccessTokenRevoked ($ tokenId ): bool
227+ public function isAccessTokenRevoked (string $ tokenId ): bool
231228 {
232229 $ accessToken = $ this ->findById ($ tokenId );
233230
@@ -286,7 +283,7 @@ private function update(AccessTokenEntity $accessTokenEntity): void
286283 $ this ->helpers ->dateTime ()->getSecondsToExpirationTime (
287284 $ accessTokenEntity ->getExpiryDateTime ()->getTimestamp (),
288285 ),
289- $ this ->getCacheKey (( string ) $ accessTokenEntity ->getIdentifier ()),
286+ $ this ->getCacheKey ($ accessTokenEntity ->getIdentifier ()),
290287 );
291288 }
292289
0 commit comments