Skip to content

Commit

Permalink
revert fix deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Feb 7, 2025
1 parent 871c337 commit 58908c6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/AuthorizationValidators/BearerTokenValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,13 @@ private function initJwtConfiguration(): void
throw new RuntimeException('Public key is empty');
}

$validationConstraints = [
$this->jwtConfiguration->setValidationConstraints(

Check failure on line 77 in src/AuthorizationValidators/BearerTokenValidator.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2, prefer-stable, ubuntu-latest)

Call to deprecated method setValidationConstraints() of class Lcobucci\JWT\Configuration: Deprecated since v5.5, please use {@see self::withValidationConstraints()} instead

Check failure on line 77 in src/AuthorizationValidators/BearerTokenValidator.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3, prefer-stable, ubuntu-latest)

Call to deprecated method setValidationConstraints() of class Lcobucci\JWT\Configuration: Deprecated since v5.5, please use {@see self::withValidationConstraints()} instead

Check failure on line 77 in src/AuthorizationValidators/BearerTokenValidator.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4, prefer-stable, ubuntu-latest)

Call to deprecated method setValidationConstraints() of class Lcobucci\JWT\Configuration: Deprecated since v5.5, please use {@see self::withValidationConstraints()} instead
new LooseValidAt($clock, $this->jwtValidAtDateLeeway),
new SignedWith(
new Sha256(),
InMemory::plainText($publicKeyContents, $this->publicKey->getPassPhrase() ?? '')
),
];

// TODO: next major release: bump lcobucci/jwt to ^5.5 and remove the following check
if (method_exists($this->jwtConfiguration, 'withValidationConstraints') === true) {
$this->jwtConfiguration = $this->jwtConfiguration->withValidationConstraints(...$validationConstraints);
} else {
$this->jwtConfiguration->setValidationConstraints(...$validationConstraints);
}
)
);
}

/**
Expand Down

0 comments on commit 58908c6

Please sign in to comment.