Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Fix generic type for FormErrorIterator#45322
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
fabpot merged 1 commit intosymfony:5.4fromakalineskou:form-fix-generic-type-for-form-error-iteratorFeb 5, 2022
Merged
Fix generic type for FormErrorIterator#45322
fabpot merged 1 commit intosymfony:5.4fromakalineskou:form-fix-generic-type-for-form-error-iteratorFeb 5, 2022
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
derrabus approved these changesFeb 5, 2022
fabpot approved these changesFeb 5, 2022
Member
fabpot commentedFeb 5, 2022
Thank you@akalineskou. |
fabpot added a commit that referenced this pull requestMar 12, 2022
This PR was squashed before being merged into the 5.4 branch.Discussion----------Make FormErrorIterator generic| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes/no| New feature? | yes/no| Deprecations? | no| Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->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 return `FormErrorIterator<FormError>` most of the time (which is possible by psalm/phpstan plugins with ReturnTypeProviders).Commits-------08ddac5 Make FormErrorIterator generic
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After upgrading symfony/form (v5.4.2 => v5.4.3) I was getting weird phpstan errors
I pass
FormErrorIterator $formErrorsand iterate over it, and do different things if it's an instance ofFormErrorIteratororFormErrorThis change fixes it
It was introduced here
https://github.com/symfony/symfony/pull/42471/files#diff-48af5e26fa9979e5508cc18c8921ed13fd1a870706108285bada83f18278ff8eR32