Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI] Default undefined env to empty string during compile#28838
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
src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ro0NL commentedOct 16, 2018 • 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.
To further clarify, this makes the |
fabpot commentedOct 17, 2018
Thank you@ro0NL. |
…(ro0NL)This PR was squashed before being merged into the 4.1 branch (closes#28838).Discussion----------[DI] Default undefined env to empty string during compile| Q | A| ------------- | ---| Branch? | 4.1| Bug fix? | yes| New feature? | no| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#28827| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->Instead of using `null` for undefined envs, use `""` instead. We already default the type to string, so actually providing a string value makes sense. During runtime it will always be string also.Commits-------38a8ab9 [DI] Default undefined env to empty string during compile
…o0NL)This PR was squashed before being merged into the 4.3-dev branch (closes#28858).Discussion----------[DI] Deprecated using env vars with cannotBeEmpty()| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes-ish| New feature? | yes| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | yes| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#28827| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->Continuation of#28838 for 4.2Using environment variables for nodes marked `cannotBeEmpty()` is semantically not possible, we'll never know the value is empty yes/no during compile time. Neither we should assume one or another.Commits-------397c19e [DI] Deprecated using env vars with cannotBeEmpty()
Instead of using
nullfor undefined envs, use""instead. We already default the type to string, so actually providing a string value makes sense. During runtime it will always be string also.