Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Fix nullable types handling#20152
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
nicolas-grekas commentedOct 4, 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.
The current code builds on top of a non existing semantical difference between |
nicolas-grekas commentedOct 4, 2016
Fixes the current failures on 3.1 for HHVM. |
| publicfunctionsupports(Request$request,ArgumentMetadata$argument) | ||
| { | ||
| return$argument->hasDefaultValue() ||$argument->isNullable(); | ||
| return$argument->hasDefaultValue() ||($argument->isNullable() && !$argument->isVariadic()); |
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 don't think variadic works here either way (php 7.0 and 7.1):
php > function (...$foo = []) {};PHP Fatal error: Variadic parameter cannot have a default value in php shell code on line 1
nicolas-grekasOct 4, 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.
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.
but variadics allow null:function foo(...$bar) {}; =>foo(null) is allowed, that's the point here.
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.
Ah the previous case wouldn't even reach here, fair enough
fabpot commentedOct 4, 2016
Thank you@nicolas-grekas. |
This PR was merged into the 3.1 branch.Discussion----------[HttpKernel] Fix nullable types handling| Q | A| ------------- | ---| Branch? | 3.1| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#19784| License | MIT| Doc PR | -Commits-------0884518 [HttpKernel] Fix nullable types handling
Uh oh!
There was an error while loading.Please reload this page.