Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Form] Deprecate passing false as $label to ChoiceListFactoryInterface#33074
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
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
9b7ca2b to90aaa6cComparenicolas-grekas commentedAug 11, 2019
Passing false looks fine to me. I'm not sure we should do this for the sake of adding type hints. Every deprecation adds to the migration process, we already have a lot of them. I'd prefer updating the docblock and mention that false is legal (and explain the purpose of it of course.) |
vudaltsov commentedAug 11, 2019
Okay, I agree, this went too far :) |
Tobion commentedAug 11, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't think anyone will be affected by this. Poeple use the option and are unlikely to have changed the implementation. Otherwise I would also say it's not worth it. But currently there are two ways to do the same thing: passing false and passing a callable that returns false. And passing false directly violates the interface. So either we need to break BC by changing the interface or we need to do this here. So to me, this PR is the better solution. |
vudaltsov commentedAug 11, 2019
Then let's finish this!@yceruto , I've just committed what you proposed. Did I get you right? |
src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
vudaltsov commentedAug 12, 2019
@yceruto , thanx, done. Also added tests to make sure the deprecation is triggered by default. |
3b43b43 to79a3ee2Comparenicolas-grekas commentedAug 12, 2019
This looks clumsy. I'm for updating the type annotation and declare it as |
yceruto commentedAug 12, 2019
Yes, I agree it could be the simpler variant. |
…teView $label argument (vudaltsov)This PR was merged into the 3.4 branch.Discussion----------[Form] Add bool type to ChoiceListFactoryInterface::createView $label argument| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aReplaces#33074Ping@nicolas-grekas ,@Tobion ,@yceruto .Commits-------8f5d1ca Add false type to ChoiceListFactoryInterface::createView $label argument
Replaces#32955 , see#32955 (comment)