-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Allow null
in InputBag@set
#37327
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
@yceruto open against 5.1 here. |
The travis failure looks related, can you please have a look? |
@chalasr fixed that test. On Travis re-run the 7.3 branch is failing with a bunch of unrelated PDO failures. |
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.
Thanks for the feedback and the 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.
Thanks!
Thank you @taylorotwell. And congratz for your first contribution to Symfony! :) |
Could we partially revert #37265 then? |
…sademont) This PR was merged into the 5.3-dev branch. Discussion ---------- [HttpFoundation] Use InputBag for POST requests too | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Partially revert #37265 | License | MIT | Doc PR | - #37265 was created as a fix for #37100. However, when #37327 was merged, the original bug was also fixed with a different solution (allowing null values on `InputBag::set`) and parts of #37265 are not needed anymore. By using only `InputBag` as the `$request` bag we can tighten the typehint again and make static analysis a bit more useful. Commits ------- 381a0a1 use InputBag for POST requests too, added missing scalar type hints
This allows
null
to be passed to InputBag'sset
method.Previously,
null
was an allowed value to the InputBag'sset
method. At some point this was deprecated. It would be very nice for us to be able to set this tonull
. For example, this ability drives a very popular feature of Laravel where we ship a middleware that converts all empty strings tonull
on incoming requests.Note that the
get
method already specifically allowsnull
andnull
is a valid decoded JSON value.