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] support array of instance validation#17032
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
EVODelavega commentedDec 16, 2015
PR was reviewed in previous PR, so setting status to reviewed now |
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.
is
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'd say "Whether the $value is of the allowed type".
stof commentedDec 17, 2015
there is a bunch of unrelated changes in this PR, making me think you messed the history a bit. |
nicolas-grekas commentedDec 18, 2015
Status: needs work (git history rebasing+squashing) |
soullivaneuh commentedDec 18, 2015
@EVODelavega Are you also planning for a documentation PR about that? |
EVODelavega commentedDec 18, 2015
@soullivaneuh Just looking at the comments. I'd be more than happy to create a documentation PR, after I've fixed the docblocks. @nicolas-grekas: Do I reallyhave to rebase + squash everything? If so: squash everything into a single commit and rebase on master? |
3aa9e04 to7b0594dCompareEVODelavega commentedDec 18, 2015
@soullivaneuh Createddocumentation PR |
CHANGELOG-3.0.md Outdated
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.
This change should be done in a different PR.
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.
Created a PR for the typo. Should I revert this change, or simply wait for the other PR to get merged and rebase the changes here?
This PR was merged into the 3.1-dev branch.Discussion----------Fix typo in changelog| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17084| License | MIT| Doc PR | -Create separate PR as requested in [OptionsResolver PR](#17032)Commits-------6508b3d Fix typo in changelog
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.
all the calls to mb_substr should be replaced by plain substr calls imho
| if (function_exists($isFunction ='is_'.$type)) { | ||
| return$isFunction($value); | ||
| } | ||
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.
The parenthesis can be removed.
fabpot commentedJun 16, 2016
This looks like a good new feature. What do you think @symfony/deciders? |
| CHANGELOG | ||
| ========= | ||
| 3.1.0 |
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.
Should be changed to 3.2.0 now.
Tobion commentedJun 16, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In general I think the feature is not bad. I'm just not sure if it's worth since there is an easy solution already:#15524 (comment) Also, the allowed types now look like phpdoc vars but do not actually support all of the phpdoc features like |
fabpot commentedJun 17, 2016
I don't find the solution you mentioned that easy; and probably less than just having to add |
xabbuh commentedJun 17, 2016
I am 👍 for supporting this. Looks quite reasonable and straight forward to me. |
Tobion commentedJun 18, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Keep in mind the phpdoc interpretation of |
fabpot commentedJun 19, 2016
@Tobion I think this is not relevant for this PR as we are not implementing a phpdoc or PSR-5. We are just reusing something that people can understand easily as they are familiar with this notation. |
fabpot commentedJun 21, 2016
@EVODelavega Do you have time to take the comments into accounts? |
EVODelavega commentedJun 21, 2016
@fabpot It's been a while since I last looked at this PR, but I'm going to take all of the comments into account, work on it some more, and I'll let you know when it's ready. Thanks. |
fabpot commentedNov 9, 2016
@EVODelavega Are you still interested in finishing this PR? |
bendavies commentedMar 6, 2017
Just came searching for this feature. Any interest in finishing this off? Or someone taking over? |
bendavies commentedMar 6, 2017
I don't mind taking over if OP has no time. |
soullivaneuh commentedJun 19, 2017
Or maybe someone else? |
pierredup commentedJun 20, 2017
EVODelavega commentedJun 23, 2017
Ouch, is this still going? Erm, I suppose I can pick it up again should this be needed. It looks like the other PR implements this feature, though. I've switched from PHP to golang since opening this PR, so if there's an alternative PR that is more up-to-date, feel free to close this one. |
nicolas-grekas commentedSep 26, 2017
@EVODelavega would you be up rebasing this PR on 3.4 by the end of the week? Feature freeze is coming and there are some comments still pending also. |
…pe (pierredup)This PR was merged into the 3.4 branch.Discussion----------[OptionsResolver] Support array of types in allowed type| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17032,#15524| License | MIT| Doc PR | TBDThis replaces#17032 with a simpler approach to allow an array of types in the allowed types for the options resolverNote: This implementation doesn't support nested values (I.E `int[][]`), but if there is a strong need for it, I'll add it in another PRCommits-------d066a23 Support array of types in allowed type
…VODelavega, wouterj)This PR was merged into the 3.4 branch.Discussion----------[OptionsResolver] Documented validation of array typesThis continues#6048 . The feature was finally merged into symfony 3.4 (congratz@EVODelavega!), so let's document it!Related Symfony PR:symfony/symfony#17032Commits-------cb12592 Merged new example in older example, removing some text318e199 Fix typobf5d9d3 Document typed arrays in optionsresolver
A suggested approach to add support for typed-arrays as allowed types, using a simple recursive method.
ClosingPR 15671.