From 2689aa721f986325ee596c3b5d8524dd6ecebac8 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Wed, 8 Dec 2021 18:59:07 +0100 Subject: [PATCH] Use strict equality --- Security/Http/Cookie/JWTCookieProvider.php | 2 +- Tests/Security/Http/Cookie/JWTCookieProviderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Security/Http/Cookie/JWTCookieProvider.php b/Security/Http/Cookie/JWTCookieProvider.php index 12b62129..f8cb9140 100644 --- a/Security/Http/Cookie/JWTCookieProvider.php +++ b/Security/Http/Cookie/JWTCookieProvider.php @@ -51,7 +51,7 @@ public function createCookie(string $jwt, ?string $name = null, $expiresAt = nul $jwt = $jwtParts->getParts($split ?: $this->defaultSplit); if (null === $expiresAt) { - $expiresAt = $this->defaultLifetime == 0 ? 0 : (time() + $this->defaultLifetime); + $expiresAt = 0 === $this->defaultLifetime ? 0 : (time() + $this->defaultLifetime); } return new Cookie( diff --git a/Tests/Security/Http/Cookie/JWTCookieProviderTest.php b/Tests/Security/Http/Cookie/JWTCookieProviderTest.php index 9fe7def8..7c4ed7f8 100644 --- a/Tests/Security/Http/Cookie/JWTCookieProviderTest.php +++ b/Tests/Security/Http/Cookie/JWTCookieProviderTest.php @@ -35,4 +35,4 @@ public function testCreateSessionCookie() $this->assertEquals(0, $cookie->getExpiresTime()); } -} \ No newline at end of file +}