Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Add missing return types and enforce return types on all methods#50821
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
d17bde8 to7529f32Comparewouterj commentedJun 29, 2023
@nicolas-grekas I'm afraid I need your help with the data collector return types. It sometimes seem to return a |
7529f32 to29a8eecComparenicolas-grekas commentedJun 29, 2023
What about going with mixed? We changed some of them to return Data instead of the original data because from the pov of a twig template, we can make a Data object behave as the original one. mixed and |
stof commentedJun 29, 2023
|
src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
29a8eec tod700820Compared700820 to7f5270cComparewouterj commentedJun 29, 2023
Alright, I did some further testing and it seems like scalar types are kept as-is, while other types become |
7f5270c to25376c6CompareUh oh!
There was an error while loading.Please reload this page.
7665b3a to189c3c8Comparenicolas-grekas commentedJun 30, 2023
Thank you@wouterj. |
In 6.3, we enforced return types on all interface methods. We're missing just a handful return types on non-interface methods (all fixed in this PR). As you can see, the added return types are either data collectors or methods introduced by 6.3 features.
In my opinion, we should start to enforce return types on all methods from 6.4 (either as PHPdoc - for
resourceand to avoid BC breaks - or PHP native declaration).