Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[OptionsResolver] Support union of types#59354
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
carsonbot commentedJan 3, 2025
Hey! Thanks for your PR. You are targeting branch "7.3" but it seems your PR description refers to branch "7.3 for features". Cheers! Carsonbot |
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.
Good addition 👍 thanks!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Also, we could find a regex that matches all possible variants instead of checking them one by one. |
VincentLanglet commentedJan 3, 2025 • 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.
Didn't find an easy one, but I'm opened to suggestion. I preferred to add the logic in the existing recursive implementation |
c5fd1c9
tof34466a
CompareI found edge case where my previous implementation remove badly parenthesis, so I now introduce a private method |
src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Could you confirm that class Union is also supported with this new syntax? i.e. |
5aed5da
toaca37dc
Compare
I added a test for |
c43650c
tob108355
CompareThank you@VincentLanglet. |
cd24b4b
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
…hangelog (alamirault)This PR was merged into the 7.3 branch.Discussion----------[OptionsResolver] Add missing support of union type in changelog| Q | A| ------------- | ---| Branch? | 7.3| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->| License | MITI found changelog is missing while documentingsymfony/symfony-docs#20531Code PR:#59354Commits-------946278f [OptionsResolver] Add missing support of union type
Uh oh!
There was an error while loading.Please reload this page.
Add support for
|
syntax when describing allowedType in OptionResolver.It's not really useful for
int|string
since we can pass an array['string', 'int']
.But it's useful for array values since
(int|string)[]
was not possible so far and['string[]', 'int[]']
was not the same thing.