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
Enable more checks for native classes on PHP 8 #7476
base: master
Are you sure you want to change the base?
Conversation
I found these snippets: https://psalm.dev/r/66d598df84<?php
class Foo implements Iterator
{
public function current(string $foo) {
return 'foo';
}
public function next($a) {
}
public function key() {}
public function valid(): string
{
return 'foo';
}
public function rewind(): void
{
}
}
|
All done, the checks are enabled when targeting 8.0+. |
Thanks for the work. I'm afraid we have some issues about We had to disable your other related feature about type inheritance in the core because of that stub issue so I feat this will be compromised as well. Please keep this open, if the fix is made in the stubs, we'll be able to merge that then |
Coupled with #7475, aims to reach feature parity with phpstan vs psalm.
This PR enables these checks only on 8.1, and like phpstan it doesn't support suppression via the ReturnTypeWillChange attribute, which could possibly cause BC problems when seeking to support PHP 7 (unlike my earlier merged PR which does support ReturnTypeWillChange, but doesn't check for things like mismatched types).