From cef8db6fe57a3b5c3b156a68100d8c180011acc5 Mon Sep 17 00:00:00 2001 From: Ronald Marfoldi Date: Tue, 10 Feb 2026 14:05:08 +0100 Subject: [PATCH 1/3] Upgrade lcobucci/jwt to v5 --- .phpunit.cache/test-results | 1 + composer.json | 6 +- ecs.php | 204 +++++++----------- src/Configuration/OAuth2Configuration.php | 14 +- src/Controller/Api/AbstractAuthController.php | 1 - .../ValidateOAuth2AccessTokenProcess.php | 5 +- src/Model/AccessTokenDto.php | 1 - src/Resources/config/authorization.php | 2 +- .../Handler/Handlers/JwtHandler.php | 2 +- src/Util/JwtUtil.php | 10 +- 10 files changed, 111 insertions(+), 135 deletions(-) create mode 100644 .phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..7049ede --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":2,"defects":[],"times":{"AnzuSystems\\AuthBundle\\Tests\\DependencyInjection\\AnzuSystemsAuthExtensionTest::testEmptyConfiguration":0.493,"AnzuSystems\\AuthBundle\\Tests\\DependencyInjection\\AnzuSystemsAuthExtensionTest::testFullConfiguration":0.003,"AnzuSystems\\AuthBundle\\Tests\\Util\\HttpUtilTest::testStoreJwtOnResponse":0.01,"AnzuSystems\\AuthBundle\\Tests\\Util\\JwtUtilTest::testCreate":0.001,"AnzuSystems\\AuthBundle\\Tests\\Util\\JwtUtilTest::testCreateWithClaims":0.001}} \ No newline at end of file diff --git a/composer.json b/composer.json index cccf5ea..75e8ab7 100644 --- a/composer.json +++ b/composer.json @@ -16,15 +16,15 @@ "ext-redis": "*", "anzusystems/common-bundle": "^8.0|^9.0|^10.0", "doctrine/common": "^3.3", - "lcobucci/jwt": "^4.2" + "lcobucci/clock": "^3.0", + "lcobucci/jwt": "^5.5" }, "require-dev": { "doctrine/orm": "^2.13|^3.0", "nelmio/api-doc-bundle": "^4.9", "slevomat/coding-standard": "8.20.0", - "squizlabs/php_codesniffer": "^3.13.2", "symfony/test-pack": "^1.0", - "symplify/easy-coding-standard": "^11.1", + "symplify/easy-coding-standard": "^13.0", "vimeo/psalm": "^6.0" }, "autoload": { diff --git a/ecs.php b/ecs.php index f88ff6b..84c2785 100644 --- a/ecs.php +++ b/ecs.php @@ -1,7 +1,7 @@ import(SetList::CLEAN_CODE); - $ECSConfig->import(SetList::PSR_12); - $ECSConfig->import(SetList::COMMON); - - $parameters = $ECSConfig->parameters(); - $parameters->set(Option::PARALLEL, true); - $parameters->set(Option::DEBUG, true); - - $ECSConfig->cacheDirectory(__DIR__ . '/var/ecs_cache'); - $ECSConfig->skip([ - Configuration::class, - PhpdocTypesOrderFixer::class, +return ECSConfig::configure() + ->withPreparedSets(psr12: true, common: true, cleanCode: true) + ->withParallel() + ->withCache(directory: __DIR__ . '/var/ecs_cache') + ->withPaths(paths: [ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) + ->withSkip([ ArrayListItemNewlineFixer::class => null, PhpdocToCommentFixer::class => null, PhpdocAlignFixer::class => null, @@ -74,104 +61,75 @@ DoctrineAnnotationBracesFixer::class => null, NotOperatorWithSuccessorSpaceFixer::class => null, UselessParenthesesSniff::class => null, - PhpdocSeparationFixer::class => null, // some bug with infinity applied checker - MethodChainingIndentationFixer::class => ['DependencyInjection/*Configuration.php'], - 'SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff.DuplicateDeclareStrictTypesSpaces' => null, + MethodChainingIndentationFixer::class => ['src/DependencyInjection/*Configuration.php'], + 'SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff.WriteOnlyProperty' => ['src/Entity/User.php'], + 'SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff.DuplicateSpaces' => null, 'SlevomatCodingStandard\Sniffs\Commenting\DisallowCommentAfterCodeSniff.DisallowedCommentAfterCode' => null, - PhpdocAnnotationWithoutDotFixer::class => null, - PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class => null // bug: removes usages of attributes if attributes are in one line i.e. #[OARequest, OAResponse] - ]); - - $services = $ECSConfig->services(); - - $services->set(NoSuperfluousPhpdocTagsFixer::class) - ->call('configure', [['remove_inheritdoc' => false, 'allow_mixed' => false]]); - - $services->set(ClassDefinitionFixer::class) - ->call('configure', [['multi_line_extends_each_single_line' => false]]); - - $services->set(ClassAttributesSeparationFixer::class) - ->call('configure', [['elements' => ['method', 'property']]]); - - $services->set(DocCommentSpacingSniff::class) - ->property('annotationsGroups', [ - '@inheritDoc', - '@template, @extends, @implements, @template-implements @template-extends', - '@var, @psalm-var, @param, @psalm-param', - '@return, @psalm-return', - '@throws', - '@psalm-suppress', - ]) - ; - - $services->set(MethodSpacingSniff::class); - $services->set(PropertySpacingSniff::class) - ->property('minLinesCountBeforeWithComment', 1) - ->property('maxLinesCountBeforeWithComment', 1) - ->property('maxLinesCountBeforeWithoutComment', 0); - - $services->set(UnusedUsesSniff::class) - ->property('searchAnnotations', true); - - $services->set(DeclareStrictTypesFixer::class); - $services->set(NoNullPropertyInitializationFixer::class); - $services->set(YodaStyleFixer::class); - $services->set(ArrowFunctionDeclarationSniff::class); - $services->set(StrictCallSniff::class); - $services->set(UseDoesNotStartWithBackslashSniff::class); - $services->set(AlphabeticallySortedUsesSniff::class); - $services->set(RequireNumericLiteralSeparatorSniff::class); - $services->set(UselessParenthesesSniff::class); - $services->set(RequireNullCoalesceOperatorSniff::class); - $services->set(ModernClassNameReferenceSniff::class); - $services->set(UselessInheritDocCommentSniff::class); - $services->set(UseFromSameNamespaceSniff::class); - $services->set(UnusedInheritedVariablePassedToClosureSniff::class); - $services->set(UselessConstantTypeHintSniff::class); - $services->set(DoctrineAnnotationArrayAssignmentFixer::class); - $services->set(DoctrineAnnotationIndentationFixer::class); - $services->set(DoctrineAnnotationSpacesFixer::class); - - $services->set(ForbiddenFunctionsSniff::class) - ->property('forbiddenFunctions', [ - 'chop' => 'rtrim', - 'close' => 'closedir', - 'delete' => 'unset', - 'doubleval' => 'floatval', - 'fputs' => 'fwrite', - 'imap_create' => 'createmailbox', - 'imap_fetchtext' => 'body', - 'imap_header' => 'headerinfo', - 'imap_listmailbox' => 'list', - 'imap_listsubscribed' => 'lsub', - 'imap_rename' => 'renamemailbox', - 'imap_scan' => 'listscan', - 'imap_scanmailbox' => 'listscan', - 'mt_rand' => 'random_int', - 'ini_alter' => 'set', - 'is_double' => 'is_float', - 'is_integer' => 'is_int', - 'is_null' => '!== null', - 'is_real' => 'is_float', - 'is_writeable' => 'is_writable', - 'join' => 'implode', - 'key_exists' => 'array_key_exists', - 'magic_quotes_runtime' => 'set_magic_quotes_runtime', - 'pos' => 'current', - 'rand' => 'random_int', - 'show_source' => 'file', - 'sizeof' => 'count', - 'strchr' => 'strstr', - 'create_function' => null, - 'call_user_func' => null, - 'call_user_func_array' => null, - 'forward_static_call' => null, - 'forward_static_call_array' => null, - ]); - - $services->set(ArraySyntaxFixer::class) - ->call('configure', [['syntax' => 'short']]); - - $services->set(ListSyntaxFixer::class) - ->call('configure', [['syntax' => 'short']]); -}; + ]) + ->withConfiguredRule(NoSuperfluousPhpdocTagsFixer::class, ['remove_inheritdoc' => false, 'allow_mixed' => false]) + ->withConfiguredRule(ClassDefinitionFixer::class, ['multi_line_extends_each_single_line' => false]) + ->withConfiguredRule(ClassAttributesSeparationFixer::class, ['elements' => ['method', 'property']]) + ->withConfiguredRule(ArraySyntaxFixer::class, ['syntax' => 'short']) + ->withConfiguredRule(ListSyntaxFixer::class, ['syntax' => 'short']) + ->withConfiguredRule(PropertySpacingSniff::class, ['minLinesCountBeforeWithComment' => 1, 'maxLinesCountBeforeWithComment' => 1, 'maxLinesCountBeforeWithoutComment' => 0]) + ->withConfiguredRule(UnusedUsesSniff::class, ['searchAnnotations' => true]) + ->withConfiguredRule(YodaStyleFixer::class, ['identical' => true]) + ->withConfiguredRule(ForbiddenFunctionsSniff::class, ['forbiddenFunctions' => [ + 'chop' => 'rtrim', + 'close' => 'closedir', + 'delete' => 'unset', + 'doubleval' => 'floatval', + 'fputs' => 'fwrite', + 'imap_create' => 'createmailbox', + 'imap_fetchtext' => 'body', + 'imap_header' => 'headerinfo', + 'imap_listmailbox' => 'list', + 'imap_listsubscribed' => 'lsub', + 'imap_rename' => 'renamemailbox', + 'imap_scan' => 'listscan', + 'imap_scanmailbox' => 'listscan', + 'mt_rand' => 'random_int', + 'ini_alter' => 'set', + 'is_double' => 'is_float', + 'is_integer' => 'is_int', + 'is_null' => '!== null', + 'is_real' => 'is_float', + 'is_writeable' => 'is_writable', + 'join' => 'implode', + 'key_exists' => 'array_key_exists', + 'magic_quotes_runtime' => 'set_magic_quotes_runtime', + 'pos' => 'current', + 'rand' => 'random_int', + 'show_source' => 'file', + 'sizeof' => 'count', + 'strchr' => 'strstr', + 'create_function' => null, + 'call_user_func' => null, + 'call_user_func_array' => null, + 'forward_static_call' => null, + 'forward_static_call_array' => null, + 'dump' => null, + 'die' => null, + 'dd' => null, + 'echo' => null, + 'var_dump' => null, + ]]) + ->withRules([ + DeclareStrictTypesFixer::class, + NoNullPropertyInitializationFixer::class, + ArrowFunctionDeclarationSniff::class, + StrictCallSniff::class, + UseDoesNotStartWithBackslashSniff::class, + AlphabeticallySortedUsesSniff::class, + RequireNumericLiteralSeparatorSniff::class, + UselessParenthesesSniff::class, + RequireNullCoalesceOperatorSniff::class, + ModernClassNameReferenceSniff::class, + UselessInheritDocCommentSniff::class, + UseFromSameNamespaceSniff::class, + UnusedInheritedVariablePassedToClosureSniff::class, + DoctrineAnnotationArrayAssignmentFixer::class, + DoctrineAnnotationIndentationFixer::class, + DoctrineAnnotationSpacesFixer::class, + ]) +; diff --git a/src/Configuration/OAuth2Configuration.php b/src/Configuration/OAuth2Configuration.php index a7fd766..8ce20d5 100644 --- a/src/Configuration/OAuth2Configuration.php +++ b/src/Configuration/OAuth2Configuration.php @@ -12,18 +12,25 @@ final class OAuth2Configuration public const SSO_USER_ID_PLACEHOLDER_URL = '{userId}'; public const SSO_USER_EMAIL_PLACEHOLDER_URL = '{email}'; + /** + * @param non-empty-string $ssoClientId + */ public function __construct( private readonly string $ssoAccessTokenUrl, private readonly string $ssoAuthorizeUrl, private readonly string $ssoRedirectUrl, private readonly string $ssoUserInfoUrl, private readonly string $ssoUserInfoByEmailUrl, - /** @var class-string */ + /** + * @var class-string + */ private readonly string $ssoUserInfoClass, private readonly string $ssoClientId, private readonly string $ssoClientSecret, private readonly string $ssoPublicCert, - /** @var list */ + /** + * @var list + */ private readonly array $ssoScopes, private readonly string $ssoScopeDelimiter, private readonly bool $considerAccessTokenAsJwt, @@ -81,6 +88,9 @@ public function getSsoRedirectUrl(): string return $this->ssoRedirectUrl; } + /** + * @return non-empty-string + */ public function getSsoClientId(): string { return $this->ssoClientId; diff --git a/src/Controller/Api/AbstractAuthController.php b/src/Controller/Api/AbstractAuthController.php index e759a18..07cd831 100644 --- a/src/Controller/Api/AbstractAuthController.php +++ b/src/Controller/Api/AbstractAuthController.php @@ -33,7 +33,6 @@ public function refreshToken(Request $request): Response return $this->refreshTokenProcess->execute($request); } - #[Route('logout', name: 'logout', methods: [Request::METHOD_GET])] #[OA\Response( response: Response::HTTP_FOUND, diff --git a/src/Domain/Process/OAuth2/ValidateOAuth2AccessTokenProcess.php b/src/Domain/Process/OAuth2/ValidateOAuth2AccessTokenProcess.php index 6667862..f14a93a 100644 --- a/src/Domain/Process/OAuth2/ValidateOAuth2AccessTokenProcess.php +++ b/src/Domain/Process/OAuth2/ValidateOAuth2AccessTokenProcess.php @@ -35,9 +35,12 @@ public function execute(Plain $token): void throw new InvalidJwtException('Please configure SSO public certificate.'); } + /** @psalm-var non-empty-string $subject */ + $subject = (string) $token->claims()->get(RegisteredClaims::SUBJECT); + $constraints = [ new PermittedFor($this->OAuth2Configuration->getSsoClientId()), - new RelatedTo((string) $token->claims()->get(RegisteredClaims::SUBJECT)), + new RelatedTo($subject), new SignedWith( JwtAlgorithm::from((string) $token->headers()->get('alg'))->signer(), InMemory::plainText($this->OAuth2Configuration->getSsoPublicCert()) diff --git a/src/Model/AccessTokenDto.php b/src/Model/AccessTokenDto.php index b2f171d..8dfc0f2 100644 --- a/src/Model/AccessTokenDto.php +++ b/src/Model/AccessTokenDto.php @@ -22,7 +22,6 @@ public function __construct(string $accessToken, DateTimeInterface $expiresAt, ? $this->jwt = $accessTokenJwt; } - public function getJwt(): ?Plain { return $this->jwt; diff --git a/src/Resources/config/authorization.php b/src/Resources/config/authorization.php index 388a7fc..c855885 100644 --- a/src/Resources/config/authorization.php +++ b/src/Resources/config/authorization.php @@ -46,6 +46,6 @@ ->args([ service('security.user_providers'), ]) - ->tag('kernel.event_listener', ['event' => CheckPassportEvent::class, 'priority' => 1024, 'method' => 'checkPassport']) + ->tag('kernel.event_listener', ['event' => CheckPassportEvent::class, 'priority' => 1_024, 'method' => 'checkPassport']) ; }; diff --git a/src/Serializer/Handler/Handlers/JwtHandler.php b/src/Serializer/Handler/Handlers/JwtHandler.php index e0d2f74..6c38918 100644 --- a/src/Serializer/Handler/Handlers/JwtHandler.php +++ b/src/Serializer/Handler/Handlers/JwtHandler.php @@ -36,7 +36,7 @@ public function deserialize(mixed $value, Metadata $metadata): ?Plain return null; } - if (false === is_string($value)) { + if (false === is_string($value) || '' === $value) { throw new SerializerException('Value must be a type of valid JWT string'); } diff --git a/src/Util/JwtUtil.php b/src/Util/JwtUtil.php index d494c6c..d4da54e 100644 --- a/src/Util/JwtUtil.php +++ b/src/Util/JwtUtil.php @@ -43,6 +43,7 @@ public function create(string $authId, ?DateTimeImmutable $expiresAt = null, arr throw MissingConfigurationException::createForPrivateCertPath(); } + /** @psalm-var non-empty-string $authId */ $builder = (new Builder(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates())) ->permittedFor($this->jwtConfiguration->getAudience()) ->issuedAt(new DateTimeImmutable()) @@ -50,10 +51,12 @@ public function create(string $authId, ?DateTimeImmutable $expiresAt = null, arr ->expiresAt($expiresAt ?: new DateTimeImmutable(sprintf('+%d seconds', $this->jwtConfiguration->getLifetime()))) ->relatedTo($authId); + /** @psalm-var non-empty-string $key */ foreach ($claims as $key => $value) { - $builder->withClaim($key, $value); + $builder = $builder->withClaim($key, $value); } + /** @var Plain */ return $builder->getToken( $this->jwtConfiguration->getAlgorithm()->signer(), InMemory::plainText($privateCert) @@ -62,9 +65,12 @@ public function create(string $authId, ?DateTimeImmutable $expiresAt = null, arr public function validate(Token\Plain $token): bool { + /** @psalm-var non-empty-string $subject */ + $subject = (string) $token->claims()->get(RegisteredClaims::SUBJECT); + $constraints = [ new PermittedFor($this->jwtConfiguration->getAudience()), - new RelatedTo((string) $token->claims()->get(RegisteredClaims::SUBJECT)), + new RelatedTo($subject), new SignedWith( $this->jwtConfiguration->getAlgorithm()->signer(), InMemory::plainText($this->jwtConfiguration->getPublicCert()) From 9a9d801b30e54b9820c05833717742c29b416817 Mon Sep 17 00:00:00 2001 From: Ronald Marfoldi Date: Tue, 10 Feb 2026 14:06:13 +0100 Subject: [PATCH 2/3] Upgrade lcobucci/jwt to v5 --- .phpunit.cache/test-results | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.cache/test-results diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index 7049ede..0000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":2,"defects":[],"times":{"AnzuSystems\\AuthBundle\\Tests\\DependencyInjection\\AnzuSystemsAuthExtensionTest::testEmptyConfiguration":0.493,"AnzuSystems\\AuthBundle\\Tests\\DependencyInjection\\AnzuSystemsAuthExtensionTest::testFullConfiguration":0.003,"AnzuSystems\\AuthBundle\\Tests\\Util\\HttpUtilTest::testStoreJwtOnResponse":0.01,"AnzuSystems\\AuthBundle\\Tests\\Util\\JwtUtilTest::testCreate":0.001,"AnzuSystems\\AuthBundle\\Tests\\Util\\JwtUtilTest::testCreateWithClaims":0.001}} \ No newline at end of file From eae8fdbc41a19dc636ab4ea5b29e563a079252db Mon Sep 17 00:00:00 2001 From: Ronald Marfoldi Date: Tue, 10 Feb 2026 15:12:04 +0100 Subject: [PATCH 3/3] Upgrade lcobucci/jwt to v5 --- .gitignore | 1 + bin/ecs | 8 +++----- composer.json | 2 +- .../DependencyInjection/AnzuSystemsAuthExtensionTest.php | 9 ++++----- tests/Util/HttpUtilTest.php | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 01af030..d505b78 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ phpcs.xml.dist # PHPUnit /tests/coverage .phpunit +.phpunit.cache .phpunit.result.cache phpunit.xml TEST-*.xml diff --git a/bin/ecs b/bin/ecs index 7aa1d12..849d834 100755 --- a/bin/ecs +++ b/bin/ecs @@ -1,15 +1,13 @@ #!/bin/bash -# Script used to run ECS check in the application docker container +# Script used to run ECS check in the application container PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" -CHECK_DIR=${1:-src} cd "${PROJECT_ROOT}" || exit 1 if [ -f /.dockerenv ]; then - echo "[INFO] Running ECS check" - vendor/bin/ecs check --fix --config=ecs.php "${CHECK_DIR}" + vendor/bin/ecs check --fix --config=ecs.php exit fi -bin/docker-compose run --rm app bash -c \'bin/ecs "${CHECK_DIR}"\' +bin/docker-compose run --rm app bash -c \'bin/ecs\' diff --git a/composer.json b/composer.json index 75e8ab7..28a4dc2 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "require-dev": { "doctrine/orm": "^2.13|^3.0", - "nelmio/api-doc-bundle": "^4.9", + "nelmio/api-doc-bundle": "^4.38", "slevomat/coding-standard": "8.20.0", "symfony/test-pack": "^1.0", "symplify/easy-coding-standard": "^13.0", diff --git a/tests/DependencyInjection/AnzuSystemsAuthExtensionTest.php b/tests/DependencyInjection/AnzuSystemsAuthExtensionTest.php index 8bf7fd4..77c74fb 100644 --- a/tests/DependencyInjection/AnzuSystemsAuthExtensionTest.php +++ b/tests/DependencyInjection/AnzuSystemsAuthExtensionTest.php @@ -40,14 +40,14 @@ public function testEmptyConfiguration(): void $this->assertParameter('anz_js', 'anzu_systems.auth_bundle.cookie.jwt.signature_part_name'); $this->assertParameter('anz_rt', 'anzu_systems.auth_bundle.cookie.refresh_token.name'); - $this->assertParameter(31536000, 'anzu_systems.auth_bundle.cookie.refresh_token.lifetime'); + $this->assertParameter(31_536_000, 'anzu_systems.auth_bundle.cookie.refresh_token.lifetime'); $this->assertParameter('anz_rte', 'anzu_systems.auth_bundle.cookie.refresh_token.existence_name'); $this->assertParameter('anz', 'anzu_systems.auth_bundle.jwt.audience'); $this->assertParameter('ES256', 'anzu_systems.auth_bundle.jwt.algorithm'); $this->assertParameter('foo_public_cert', 'anzu_systems.auth_bundle.jwt.public_cert'); $this->assertParameter('foo_private_cert', 'anzu_systems.auth_bundle.jwt.private_cert'); - $this->assertParameter(3600, 'anzu_systems.auth_bundle.jwt.lifetime'); + $this->assertParameter(3_600, 'anzu_systems.auth_bundle.jwt.lifetime'); $this->assertNotHasDefinition(AuthenticationSuccessHandler::class); $this->assertNotHasDefinition(AuthenticationFailureHandler::class); @@ -74,15 +74,14 @@ public function testFullConfiguration(): void $this->assertParameter('anz_js', 'anzu_systems.auth_bundle.cookie.jwt.signature_part_name'); $this->assertParameter('anz_rt', 'anzu_systems.auth_bundle.cookie.refresh_token.name'); - $this->assertParameter(31536000, 'anzu_systems.auth_bundle.cookie.refresh_token.lifetime'); + $this->assertParameter(31_536_000, 'anzu_systems.auth_bundle.cookie.refresh_token.lifetime'); $this->assertParameter('anz_rte', 'anzu_systems.auth_bundle.cookie.refresh_token.existence_name'); $this->assertParameter('anz', 'anzu_systems.auth_bundle.jwt.audience'); $this->assertParameter('ES256', 'anzu_systems.auth_bundle.jwt.algorithm'); $this->assertParameter('foo_public_cert', 'anzu_systems.auth_bundle.jwt.public_cert'); $this->assertParameter('foo_private_cert', 'anzu_systems.auth_bundle.jwt.private_cert'); - $this->assertParameter(3600, 'anzu_systems.auth_bundle.jwt.lifetime'); - + $this->assertParameter(3_600, 'anzu_systems.auth_bundle.jwt.lifetime'); $this->assertHasDefinition(AuthenticationSuccessHandler::class); $this->assertHasDefinition(AuthenticationFailureHandler::class); diff --git a/tests/Util/HttpUtilTest.php b/tests/Util/HttpUtilTest.php index 0efa96e..2bca2b1 100644 --- a/tests/Util/HttpUtilTest.php +++ b/tests/Util/HttpUtilTest.php @@ -39,7 +39,7 @@ protected function setUp(): void deviceIdCookieName: 'corge', refreshTokenCookieName: 'garply', refreshTokenExistenceCookieName: 'grault', - refreshTokenLifetime: 3600, + refreshTokenLifetime: 3_600, ); $this->httpUtil = new HttpUtil( @@ -63,14 +63,14 @@ public function testStoreJwtOnResponse(): void /** @var Cookie $payloadCookie */ $payloadCookie = current( array_filter($cookies, static function (Cookie $cookie) { - return $cookie->getName() === 'qux'; + return 'qux' === $cookie->getName(); }) ); /** @var Cookie $signCookie */ $signCookie = current( array_filter($cookies, static function (Cookie $cookie) { - return $cookie->getName() === 'quux'; + return 'quux' === $cookie->getName(); }) );