-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d17bde8
to
7529f32
Compare
@nicolas-grekas I'm afraid I need your help with the data collector return types. It sometimes seem to return a |
7529f32
to
29a8eec
Compare
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 |
|
src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php
Outdated
Show resolved
Hide resolved
29a8eec
to
d700820
Compare
d700820
to
7f5270c
Compare
Alright, I did some further testing and it seems like scalar types are kept as-is, while other types become |
7f5270c
to
25376c6
Compare
7665b3a
to
189c3c8
Compare
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
resource
and to avoid BC breaks - or PHP native declaration).