Skip to content

Commit 6710412

Browse files
committed
Add method exists for addClaim on token
1 parent 1d79e35 commit 6710412

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Grant/AbstractGrant.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,10 @@ protected function issueAccessToken(
454454
$accessToken->setExpiryDateTime((new DateTimeImmutable())->add($accessTokenTTL));
455455
$accessToken->setPrivateKey($this->privateKey);
456456

457-
foreach ($claims as $claim) {
458-
$accessToken->addClaim($claim);
457+
if (method_exists($accessToken, 'addClaim')) {
458+
foreach ($claims as $claim) {
459+
$accessToken->addClaim($claim);
460+
}
459461
}
460462

461463
while ($maxGenerationAttempts-- > 0) {

0 commit comments

Comments
 (0)