diff --git a/EventListener/BlockJWTListener.php b/EventListener/BlockJWTListener.php index d1df45df..6c327a1a 100644 --- a/EventListener/BlockJWTListener.php +++ b/EventListener/BlockJWTListener.php @@ -45,14 +45,14 @@ private function blockTokenFromRequest(Request $request): void try { $payload = $this->jwtManager->parse($token); - } catch (JWTDecodeFailureException) { + } catch (JWTDecodeFailureException $e) { // Ignore decode failures, this would mean the token is invalid anyway return; } try { $this->tokenManager->add($payload); - } catch (MissingClaimException) { + } catch (MissingClaimException $e) { // We can't block a token missing the claims our system requires, so silently ignore this one } } diff --git a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php index f4194bb6..8a655a42 100644 --- a/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php +++ b/Tests/Functional/Command/ApiPlatformOpenApiExportCommandTest.php @@ -2,6 +2,7 @@ namespace Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\Command; +use ApiPlatform\OpenApi\OpenApi; use Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\TestCase; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -25,9 +26,10 @@ public function testCheckOpenApiExportCommand() $tester = new CommandTester($app->find('api:openapi:export')); $this->assertSame(0, $tester->execute([])); + $openApiVersion = class_exists(OpenApi::class) ? OpenApi::VERSION : '3.0.0'; $this->assertJsonStringEqualsJsonString(<<