-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
accepting callbacks for symfony/options-resolver -> setAllowedValues() #28129
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
Comments
Hi @jkhaled Yes, I also think that allowing |
Allowing |
@jvasseur I have just created a PR for the implementation, tested |
@jkhaled Can you post a link to the pull-request here? Thanks. |
I am against making such a change. As said above supporting all types of callables makes the option value ambiguous. That's by the way the reason we dropped this kind of support for some options provided by core form types. |
This is a BC break anyway, since a string or an array of two strings currently setting one or two allowed values could then become callable, and there is no way to prevent the break AFAIK. |
Let's close this for the reasons given by the maintainers. Also, an alternative solution was given by @yceruto. Thanks. |
Description
component : symfony/options-resolver
class: OptionsResolver
method: setAllowedValues()
add capability for setAllowedValues to accept callbacks , instead of rewriting the same Closure for same allowed value , for sharing and prevent retyping
Example
The text was updated successfully, but these errors were encountered: