Skip to content

Commit

Permalink
Fix minor psalm issues
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Feb 6, 2024
1 parent 98eeefe commit d2f70db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/Persistence/CacheHeadersGeneratorTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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'));
Expand Down Expand Up @@ -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;
}
}

0 comments on commit d2f70db

Please sign in to comment.