yubikey-val
yubikey-val copied to clipboard
Undefined Constants
I ran psalm
against the repo, and it returns a few undefined constants, which give warnings in newer versions of PHP. This codebase relies on the old-PHP behavior of converting them to strings in a lot of places. Here's a report:
ERROR: UndefinedConstant - ykval-common.php:147:22 - Const LOG_WARN is not defined
$logger->log(LOG_WARN, $ident . 'curl options must be an array');
ERROR: UndefinedConstant - ykval-common.php:153:26 - Const LOG_WARN is not defined
$logger->log(LOG_WARN, "$ident failed to set " . curl_opt_name($key));
ERROR: UndefinedConstant - ykval-db.php:71:30 - Const tm_hour is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);
ERROR: UndefinedConstant - ykval-db.php:71:47 - Const tm_min is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);
ERROR: UndefinedConstant - ykval-db.php:71:63 - Const tm_sec is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);
ERROR: UndefinedConstant - ykval-db.php:71:79 - Const tm_mon is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);
ERROR: UndefinedConstant - ykval-db.php:71:97 - Const tm_mday is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);
ERROR: UndefinedConstant - ykval-db.php:71:114 - Const tm_year is not defined
return mktime($stamp[tm_hour], $stamp[tm_min], $stamp[tm_sec], $stamp[tm_mon]+1, $stamp[tm_mday], $stamp[tm_year]);