Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Undefined Constants #60

@captn3m0

Description

@captn3m0

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]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions