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

@ -184,7 +184,7 @@ class HttpInput{
return $var;
case HttpVariableType::Integer:
// Can't use ctype_digit because we may want negative integers
if(is_numeric($var) && mb_strpos($var, '.') === false){
if(is_numeric($var) && mb_strpos(strval($var), '.') === false){
try{
return intval($var);
}

View file

@ -98,7 +98,8 @@ class Session{
}
public static function SetSessionCookie(string $sessionId): void{
setcookie('sessionid', $sessionId, ['expires' => (new DateTimeImmutable('+1 week'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
/** @throws void */
setcookie('sessionid', $sessionId, ['expires' => intval((new DateTimeImmutable('+1 week'))->format('U')), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
}
/**