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] Choose policy on unknown options#9754
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
COil commentedDec 13, 2013
👍 |
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.
please keep them on 1 line
iamluc commentedDec 13, 2013
Updated according to comments |
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.
$options is superflu here
Koc commentedDec 13, 2013
kbond commentedDec 13, 2013
Yes, this looks great! |
iamluc commentedDec 13, 2013
Fix phpdoc as suggested by pborreli + add public method setUnknownOptionPolicy($unknownOptionPolicy) |
pborreli commentedDec 13, 2013
@iamluc you should fix your git username (vieilles instead of iamluc)https://help.github.com/articles/setting-your-username-in-git and fix with |
iamluc commentedDec 13, 2013
@pborreli thanks ! done. |
stof commentedDec 13, 2013
I don't think we should have a mutator for this policy: the code instantiating the resolver should control the behavior it expects for unknown options. External code receiceving it to configure default options should not be able to change the policy IMO |
iamluc commentedDec 13, 2013
@stof OK, i will revert this. |
stof commentedDec 14, 2013
@iamluc move it back to the constructor IMO |
webmozart commentedDec 17, 2013
I would prefer if this functionality was configurable in the publicfunction resolve(array$options =array(),$flags =0); Example usage: $options =$resolver->resolve($usersOptions, OptionsResolverInterface::REMOVE_UNKNOWN); |
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.
you need to set the third argument (strict) to true, otherwise'1' would go throught but fail later
iamluc commentedDec 17, 2013
@bschussek PR updated. Is now BC because we changed Interface |
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.
must be on the same line as the}
fabpot commentedFeb 22, 2014
What is the status of this PR?@webmozart Can you check the latest version of the code? |
webmozart commentedMar 28, 2014
Replaced by#10574. |
Hi,
This commit adds the possibility to choose a policy on unknown options :