-
Notifications
You must be signed in to change notification settings - Fork 95
FormInterface::getErrors could have a dynamic return extension #166
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
Comments
I also just stumbled upon that and would love to see that, too 😊 👍 |
This shouldn't be too hard to implement ; do you want to make a try ? @mitelg |
If you can hint me where to start and maybe even an example where I can take things from, I would like to give it a try 😁 |
https://github.com/phpstan/phpstan-symfony/blob/master/src/Type/Symfony/RequestDynamicReturnTypeExtension.php You'll have to implement your own logic inside getTypeFromMethodCall, but check like |
I tried to start and currently I am stuck at defining the new return type. I think i need to return |
You have generics here: https://github.com/phpstan/phpstan-src/tree/master/src/Type/Generic |
Documentation is here: https://phpstan.org/developing-extensions/dynamic-return-type-extensions |
…Interface::getErrors' fixes phpstan#166
…Interface::getErrors' fixes #166
Fixed by #228 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Currently, its return type is a FormErrorIterator with inside
Symfony\Component\Form\FormError|Symfony\Component\Form\FormErrorIterator
The phpdoc is
So I would say it's always an iterator on
Symfony\Component\Form\FormError
, except if the parametertrue, false
are provided.The text was updated successfully, but these errors were encountered: