Fix PHPStan errors

This commit is contained in:
Mike Colagrosso 2024-06-29 13:47:54 -06:00 committed by Alex Cabal
parent 6af2717773
commit 008ffc8ccd
5 changed files with 10 additions and 5 deletions

View file

@ -1,4 +1,5 @@
<?
use Safe\DateTimeImmutable;
use function Safe\apcu_fetch;
// If the user is not logged in, or has less than some amount of downloads, show a thank-you page
@ -60,7 +61,7 @@ try{
// Increment local download count, expires in 2 weeks
$downloadCount++;
setcookie('download-count', (string)$downloadCount, ['expires' => (new DateTimeImmutable('+2 week'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']);
setcookie('download-count', (string)$downloadCount, ['expires' => intval((new DateTimeImmutable('+2 week'))->format('U')), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']);
}
catch(Exceptions\InvalidFileException | Exceptions\EbookNotFoundException){
Template::Emit404();

View file

@ -1,6 +1,7 @@
<?
// See https://developers.google.com/search/docs/data-types/book for RDFa metadata details
use Safe\DateTimeImmutable;
use function Safe\preg_match;
use function Safe\preg_replace;
use function Safe\apcu_fetch;