Skip to content

unresolvable includes disable many checks #2817

@pilif

Description

@pilif

I noticed by accident that psalm wasn't catching a typo in a static method called on a class.

After some digging, I boiled the issue down to an unresolvable include that we silenced.

Apparently, once psalm hits an unresolvable include, it silently turns off a lot of checks:

$context->check_classes = false;
$context->check_variables = false;
$context->check_functions = false;

I have a demo project here:

https://github.com/pilif/psalm/tree/unresolvable-include

src/demo.php in this project blows up with a PHP Fatal error: Uncaught Error: but psalm thinks everything is fine.

As a user, I would not expect that a suppressed warning (do note the that included file is entirely irrelevant for the rest of the project) on an include somewhere has the side-effect of turning off many checks which would even cause fatal errors at runtime if not caught.

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