New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InvalidClass does not work PHP native classes and stubs #8456
Comments
I found these snippets: https://psalm.dev/r/a2caa7560a<?php
class Hello {
}
/**
* @param hello $arg
* @return void
*/
function abc( $arg ) {
}
https://psalm.dev/r/78f1f31d1b<?php
/**
* @param dateTime $arg
* @return void
*/
function abc( $arg ) {
}
|
Issue is bc ClassLikes.php
which is necessary to check if the class exists. But not sufficient to check here. Afaik changing this:
to:
should be enough to fix this Additionally Would like some feedback on this, then can PR this |
Sounds good to me, go ahead and PR it and see if any tests fail! |
Beware, there is a lot of weirdness going on with stub dependencies. Due to cache interaction and plugins, it is not clear whether the 'user-defined' part of a stub is defined. |
https://psalm.dev/r/a2caa7560a
When class Hello is not in the project files but provided via stubs, it doesn't report InvalidClass error.
This is true for global (psalm provided) and custom (user/config provided) stubs.
e.g. DateTime:
https://psalm.dev/r/78f1f31d1b
Should give an InvalidClass error too
The text was updated successfully, but these errors were encountered: