-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Fix accepting null as default env param value #20512
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
but shouldn't we allow it ? It would be useful in case some config treats null as being "don't enable this feature", which is the case for the database_url in Doctrine (allowing to configure with username/password/host locally when not setting the URL) |
Could be, but should be allowed for all parameters then (for consistency, and because we use the same code paths for all params, env or not) |
normal parameters (non-env-based) allow to store |
9b424a1
to
c78e090
Compare
Indeed, I messed up here :) Fixed! |
public function testResolveEnvAllowsNull() | ||
{ | ||
$bag = new EnvPlaceholderParameterBag(); | ||
$bag->get('env(NULL)'); |
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.
It's a bit confusing in this test to use NULL
as the var name. What about replacing it by NULL_VAR
? (and Null_Var
in the example below)
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.
updated
👍 |
c78e090
to
98c1401
Compare
98c1401
to
7625166
Compare
👍 Status: Reviewed |
Thank you @nicolas-grekas. |
…s-grekas) This PR was merged into the 3.2-dev branch. Discussion ---------- [DI] Fix accepting null as default env param value | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20447 | License | MIT | Doc PR | - Commits ------- 7625166 [DI] Fix accepting null as default env param value
Uh oh!
There was an error while loading. Please reload this page.