-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Form] Refactor DefaultChoiceListFactory #29731
Conversation
84ba7b0
to
4abdb3d
Compare
src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php
Outdated
Show resolved
Hide resolved
This PR was merged into the 3.4 branch. Discussion ---------- [Form] Fix FormDefaultChoiceListFactory test | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29731 (review) | License | MIT | Doc PR | n/a `$groupBy` is either `null` or `callable`. Passing `array()` is wrong. Commits ------- b8f6390 Fixed groupBy argument value in DefaultChoiceListFactoryTest
4abdb3d
to
8e71c9f
Compare
Rebased |
8e71c9f
to
d1190dd
Compare
What kind of DX improvement is this PR doing ? Developers don't care about the internal implementation of the factory. They use the factory when developing their forms, they don't re-implement it. |
I meant Symfony developer's DX. I started working on #5136 when I came across the DefaultChoiceListFactory. It took me about 2 hours to get, what's going on there. |
Thank you @stof , I improved the phpdoc |
But does your refactoring change that at all ? The building of the list is still exactly the same, but moved in a different class AFAICT. |
@stof, I certainly didn't change the algorithm, but I claim that I improved the readability:
|
@nicolas-grekas , @xabbuh , @stof , @HeahDude , should I close this? Are my points above not convincing? |
Please don't close it yet. I would like to have a look at the details first. I simply didn't have the time to do that yet. Sorry. |
I'm not convinced, and it makes merging older branches more difficult (not even talking about the performance here). |
Thank you @vudaltsov, I'm sorry but I also tend to agree, that the benefit is too small so it is worth it. 👎 too on this one. |
Okay, no problem. I finally also agree with all you. My change does not really change anything :) |
In this PR I refactored a really messy
DefaultChoiceListFactory
code.Ping @HeahDude, @xabbuh.