-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[OptionsResolver] Add new OptionConfigurator class to define options with fluent interface #33848
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lmillucci for working on this feature :) I like it ! and congratulation for your first pull request.
I've left some comments to move as fast as we can, thanks again.
src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php
Outdated
Show resolved
Hide resolved
something else we may want to consider, and what we did for DI configurators as well, is to make it truly fluid; $optionsResolver
->define('foo')
->required()
->define('bar')
->required()
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With minor comments.
@lmillucci thanks for your work and for solving all comments. After the discussion we had about this #33848 (comment) where I suggest you to remove the annotation I'm sorry about that, and I hope you're okay. |
@yceruto no problem, I've easily restored |
@stof could you please review this PR again and have your vote on this ? thanks! |
ping @symfony/mergers ? |
3e44405
to
8326c70
Compare
Ready for final reviews (the fabbot.io failure is a false positive) |
@lmillucci do you like to finish this proposal? |
@yceruto Yes, what exception should be thrown when defining an already defined option? Something like |
@lmillucci yes, |
@lmillucci almost done :) you just need to rebase on |
1369e55
to
e5f8397
Compare
e5f8397
to
519acba
Compare
there is a commit that don't belongs to this PR f825642 (the first one) could you please, fix it? thanks! |
519acba
to
789dcfd
Compare
The component's CHANGELOG file should mention this change. |
…with fluent interface
Thank you @lmillucci. |
789dcfd
to
1ff5640
Compare
…define options with fluent interface (lmillucci, yceruto) This PR was merged into the 5.1-dev branch. Discussion ---------- [OptionsResolver] Add new OptionConfigurator class to define options with fluent interface | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #33735 | License | MIT | Doc PR | symfony/symfony-docs#12426 - [x] submit changes to the documentation This PR adds OptionConfigurator to the OptionsResolver Commits ------- 1ff5640 [OptionsResolver] Add new OptionConfigurator class to define options with fluent interface
…lucci) This PR was squashed before being merged into the master branch. Discussion ---------- [OptionResolver] Document the OptionConfigurator Add `define()` method to OptionResolver to enhance readability of option configuration. See symfony/symfony#33848 Commits ------- 921c73f [OptionResolver] Document the OptionConfigurator
This PR adds OptionConfigurator to the OptionsResolver