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
PHP 8.1: Report missing typehints in overridden native methods #7363
Conversation
c1e008e
to
b317874
Compare
b317874
to
d38958c
Compare
@danog, is there any reason not to add this to 4.x line? |
e512619
to
abd03db
Compare
Not really, no, I just wanted to switch directly to psalm v5 :D |
Hmm, that's weird, I rebased on top of 4.x... |
There must have been something wrong. isEmpty was only removed in master |
abd03db
to
11b14c8
Compare
All fixed! |
Is this related to #6395 (comment) ? |
Yep, it's related precisely to that. |
but then, in your PR, you doesn't seem to distinguish phpdoc from real types in signature: https://github.com/vimeo/psalm/pull/7363/files#diff-c70a8399e3804f1bb260231f6af972513c1ca05d21e3f4221ae35ad5a9d4e6c0R121 Matt's branch was all about adding types in signature to be able to make the difference I believe? |
I could've changed the reflection populator to populate Actually, do you think it should be made a separate issue, given that it signals a rather important PHP 8.1 BC semi-break? |
A different issue could be interesting indeed. About the signature_return_type vs return_type, did PHP add signatures types for every internal function/class/interface or did they do it only for certain cases? |
db8f6f6
to
d970661
Compare
The documentation says Most non-final internal methods now require overriding methods to declare a compatible return type, so I just assumed all of them did. |
@danog is this ready? |
Yep! |
Thanks! |
Allows detection of ReturnTypeWIllChange warnings, also fixes #7362