-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form][OptionResolver] Support of OptionResolver 2.6 API in AbstractType #12782
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
Labels
Comments
exactly my thoughts, what is the recommended solution for this? |
Imo, there are 2 things in this subject which should be changed in the type interface:
I think we can combine these 2 by deprecating setDefaultOptions and introducing configureOptions, which has a correct typehint. |
I am fine with this, sounds reasonable. I will have a look into this. |
I just submitted an PR with some initial work on this. |
fabpot
added a commit
that referenced
this issue
Jan 18, 2015
…igureOptions() (peterrehm) This PR was merged into the 2.7 branch. Discussion ---------- [Form] Deprecated setDefaultOptions() in favor of configureOptions() | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | | Fixed tickets | #12782 | License | MIT | Doc PR | symfony/symfony-docs#4786 This tries to provide a compatible API with the depreciation of the OptionResolverInterface. I would like to have this in 2.6.2 but I think that might not be possible? To me I think we should always provide an API where you do not need to use deprecated classes. Also can you think of any way to trigger errors on the use of the deprecated setDefaultOptions() method? Since it is usually overwritten without calling the parent class this might be tricky. Maybe only in the resolver if we can check if actual options has been resolved in a call to setDefaultOptions. Commits ------- 3d43cae Deprecated setDefaultOptions() in favor of configureOptions()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have just tried the upgrade of an application to 2.6 and followed the upgrade document.
I noticed that there were major changes in the OptionResolver component with the depreciation
of the OptionResolverInterface. This was well documented in the OptionResolver documentation.
However it looks like there is no upgrade path for form classes extending the AbstractType since
the interface requires the OptionResolverInterface. I think we should offer an upgrade path to get
rid of the depreciation warnings. Will the AbstractType setDefaultOptions be changed in 3.0 or will
there be a new method?
@webmozart Or am I missing something?
Related symfony/symfony-docs#4159 #12156
The text was updated successfully, but these errors were encountered: