Skip to content

[WIP] Bootstrapped Options Resolver Component #2353

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

Merged
merged 4 commits into from
Apr 9, 2013

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Mar 24, 2013

Q A
Doc fix? yes
New docs? no
Applies to 2.1+
Fixed tickets #2030

/cc @bschussek


.. versionadded:: 2.1
The OptionsResolver Component is new in Symfony2.1, it can be found in the
Form component in older versions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. It cannot be found anywhere in 2.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

weaverryan added a commit that referenced this pull request Apr 9, 2013
[WIP] Bootstrapped Options Resolver Component
@weaverryan weaverryan merged commit fd8f013 into symfony:2.1 Apr 9, 2013
@weaverryan
Copy link
Member

Hi Wouter!

This is a great entry - I've merged it in with only minor changes at sha: b98619e (including removing the versionadded - only because we'll shortly make 2.1 the "oldest-supported" version).

I did have one question - which I'll post as a line comment.

Thanks!

:method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::replaceDefaults`
method. This can be used to override the previous default value. The closure
that is passed has 2 parameters:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this last part (starting with The closure that is passed...) is very clear. I think we need an example here to show what you can actually do and how this closure is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it if you (or anyone) can give me a good example (I can't find a simple good 'somewhat real use-case' example for this one).

@wouterj
Copy link
Member Author

wouterj commented Apr 9, 2013

@weaverryan thanks for merging!
I planned to do some final (english) checking and commit squashing (those are a bit vague now) this week, but I'm happy you had some time improving the english!

However, are we going to remove every .. versionadded:: 2.1 block from the documentation soon? Otherwise, I disagree removing it here

@webmozart
Copy link
Contributor

Thank you for this great documentation! In my opinion, the example should be changed though. Entities are a very bad usage example, because entities are data holders that can change at any time. The OptionsResolver though is meant for configuring classes whose configuration does not change anymore after construction.

A better example might be a Mailer class for example.

@webmozart
Copy link
Contributor

And I'm completely aware that I gave this stupid example myself in the README file :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants