-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Make FormErrorIterator generic #45696
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
Conversation
I added a commit to fix the psalm build @stof ; but I don't know why it wasn't failing before. |
I don't understand this change. The current annotations look correct to me and why would |
Currently This can be more precise according to
ReturnTypeProvider for phpstan/psalm can be implemented and already half done but they require the class to be a generic. Knowing the result is only a FormErrorIterator can allow to write
without any complaints. |
Oh right. Makes sense, thanks for the explanation. |
Thank you @VincentLanglet. |
I target 5.4, since it's a follow up of #45322 which introduced some errors in my code.
It allows to typehint the
Form::getErrors
method to returnFormErrorIterator<FormError>
most of the time (which is possible by psalm/phpstan plugins with ReturnTypeProviders).