-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[OptionsResolver] Add prototype definition support for nested options #39913
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
4f4ac92
to
9daae60
Compare
Hey! I didn't know that was capable of this emotion. I really really like reviewing this PR. Well done. I think @lmillucci has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
9daae60
to
da5ebaf
Compare
There is only one thing left to clarify here, because I'm guessing that prototyping shouldn't be supported as root definition (only for nested options) do we want to throw an exception in case someone tries to do it? I mean, having a prototyped root definition. |
da5ebaf
to
8b078f4
Compare
Hi @yceruto hope, you're doing well bro. |
846f42c
to
6672a13
Compare
6672a13
to
6c83da9
Compare
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.
Can you rebase on current 5.x?
6c83da9
to
29d41b1
Compare
Done. |
Thank you @yceruto. |
…method (yceruto) This PR was merged into the 5.3-dev branch. Discussion ---------- [OptionsResolver] Documenting new setPrototype() method PR: symfony/symfony#39913 Fix: symfony#15301 Commits ------- 04316b2 Documenting prototype options
This proposal adds a new method
setPrototype(true)
to theOptionsResolver
component to mark options definition as array prototype:This feature will allow passing options this way:
You can add as many items as you want with the advantage of validating each item according to its prototype definition.
The result for this example would be:
This feature is feasible only for nested options so far and the nested option (e.g. "connections") must be of type array of array.
See the test cases for more details about this feature.
Cheers!