-
Notifications
You must be signed in to change notification settings - Fork 696
Description
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:
psalm/src/Psalm/Internal/Analyzer/Statements/Expression/IncludeAnalyzer.php
Lines 206 to 208 in 422bd25
| $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.