-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[OptionsResolver] Implemented policies for treating unknown/missing options #10574
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
Conversation
webmozart
commented
Mar 28, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #7979, replaces #9754 |
License | MIT |
Doc PR | symfony/symfony-docs#3731 |
/** | ||
* Throw an exception if a required option is missing in {@link resolve()}. | ||
*/ | ||
const FORBID_MISSING = 32; |
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.
16
missing?
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.
And what about 8?
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.
^^
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.
I left them out by intention to allow further "UNKNOWN" values to be added (if needed).
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 can also add them at the end with higher values if needed
Either we need to check all flags for mutual exclusivity, or none. Since checking all flags is expensive, I'm removing this check altogether.
Updated. |
For completness one could also add FORBID_INVALID, INGORE_INVALID and REMOVE_INVALID behavior for type and value checks. |
Btw; I think the exceptions are defined wrong because they don't respect the meaning of runtime vs logic exception.
Created #10585 as its unrelated |
@Tobion I thought about FORBID_INVALID, INGORE_INVALID and REMOVE_INVALID, but I don't really see a use case. Thanks for opening that issue! |
👍 |
@webmozart are you going to open a new PR on this ? |
Oops, I didn't realize I closed this one, I thought it was already merged. Here's the new one: #10616 |