-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Allow null
in InputBag@set
#37326
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
This allows `null` to be passed to InputBag's `set` method.
null
in InputBag@setnull
in InputBag@set
see also #37100, we discussed it quite recently.
Previously it was an instance of ParameterBag. i still think this is legit, as it allows for using decoded JSON payloads :) im not sure about hiding empty strings this way, but that's a user concern i guess. |
@ro0NL Yes, exactly. Laravel users greatly enjoy this feature. |
I can imagine. Symfony's Form component more or less does the same, on a different layer. |
I have updated the deprecation message. |
Should I retarget this to 5.1 branch on this PR? |
Yes, you should retarget your patch branch to 5.1 |
Opened against 5.1 here: #37327 |
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.