From d2f70dbdd245492040a5eab86f423403df0985b3 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 6 Feb 2024 16:58:32 +0000 Subject: [PATCH] Fix minor psalm issues Signed-off-by: George Steel --- test/Persistence/CacheHeadersGeneratorTraitTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Persistence/CacheHeadersGeneratorTraitTest.php b/test/Persistence/CacheHeadersGeneratorTraitTest.php index 999dfe7..fb7b5a0 100644 --- a/test/Persistence/CacheHeadersGeneratorTraitTest.php +++ b/test/Persistence/CacheHeadersGeneratorTraitTest.php @@ -188,7 +188,7 @@ public function testAddCacheHeadersForPublicCacheLimiter(): void $consumer = $this->createConsumerInstance($cacheExpire, 'public'); $response = $consumer->addCacheHeadersToResponse(new Response()); - $lastModified = self::getExpectedLastModified() ?: ''; + $lastModified = self::getExpectedLastModified() === false ? '' : self::getExpectedLastModified(); self::assertMatchesRegularExpression(self::GMDATE_REGEXP, $response->getHeaderLine('Expires')); self::assertSame(sprintf('public, max-age=%d', $maxAge), $response->getHeaderLine('Cache-Control')); @@ -204,7 +204,7 @@ public function testAddCacheHeadersForPrivateCacheLimiter(): void $consumer = $this->createConsumerInstance($cacheExpire, 'private'); $response = $consumer->addCacheHeadersToResponse(new Response()); - $lastModified = self::getExpectedLastModified() ?: ''; + $lastModified = self::getExpectedLastModified() === false ? '' : self::getExpectedLastModified(); self::assertMatchesRegularExpression(self::GMDATE_REGEXP, $response->getHeaderLine('Expires')); self::assertSame(sprintf('private, max-age=%d', $maxAge), $response->getHeaderLine('Cache-Control')); @@ -317,6 +317,6 @@ private static function getExpectedLastModified(): string|false $lastmod = filemtime($classFile); } - return $lastmod ? gmdate(Http::DATE_FORMAT, $lastmod) : false; + return $lastmod !== false ? gmdate(Http::DATE_FORMAT, $lastmod) : false; } }