Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 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
4f4ac92 to9daae60Comparecarsonbot commentedJan 21, 2021
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 toda5ebafCompareyceruto commentedJan 28, 2021
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 to8b078f4Compareazatyan commentedFeb 18, 2021
Hi@yceruto hope, you're doing well bro. |
846f42c to6672a13CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
6672a13 to6c83da9Compare
fabpot left a comment
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?
Uh oh!
There was an error while loading.Please reload this page.
6c83da9 to29d41b1Compareyceruto commentedApr 18, 2021
Done. |
fabpot commentedMay 1, 2021
Thank you@yceruto. |
…method (yceruto)This PR was merged into the 5.3-dev branch.Discussion----------[OptionsResolver] Documenting new setPrototype() methodPR:symfony/symfony#39913Fix:symfony#15301Commits-------04316b2 Documenting prototype options
Uh oh!
There was an error while loading.Please reload this page.
This proposal adds a new method
setPrototype(true)to theOptionsResolvercomponent 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!