-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Deprecate non-string default envs #27808
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
src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php
Outdated
Show resolved
Hide resolved
Didn't open the patch yet, still have a comment :) |
Isnt that over-complicated? IMHO there's only one real env, and thus only 1 default for it as well. Following your logic we could do:
And use Im not sure that makes sense... or at least is extremely hard to reason about.
Which we do already, the processors defined on the reference-side (e.g. for |
Ok. Deja vu: #23901 (comment) Indeed, we kept this opportunity open.. but the current implem doesnt handle this at all |
Let's say today I rely on having e.g.: |
You can't ... :)
Ok, let's use
I.e. the prefixed default is not used, which is the same behavior during config validation: symfony/src/Symfony/Component/DependencyInjection/Compiler/ValidateEnvPlaceholdersPass.php Lines 50 to 51 in f27c3a8
No. It will only trigger a deprecation declaring default env as non-string. And given any prefixed default env is not used today, i think we should deprecate that as well :) and open-up whenever it's actually supported (of which i'm not sure we should do it). |
Oh, great then I forgot that, so all good, let's make tests pass :) |
I need an extra hint :) do you suggest to make the test pass by preserving the assertion Or this PR; asserting |
@nicolas-grekas any thoughts already? |
/cc @nicolas-grekas |
@ro0NL would you mind rebasing please? I'd like to see tests green :) |
I'm afraid tests are not green yet :( |
Correct, it's still a failing test only :) to move forward the open questions are
|
👍 for me |
"do we want to deprecate non-string default envs?" 👍 |
@fabpot @nicolas-grekas this should do status: needs review |
Thank you @ro0NL. |
This PR was merged into the 4.3-dev branch. Discussion ---------- [DI] Deprecate non-string default envs | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes-ish | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes | Tests pass? | no <!-- please add some, will be required by reviewers --> | Fixed tickets | #27680, #27470 (comment) | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This is a failing test to further clarify the issues raised in #27680 So given #27680 (comment) > We should be sure this solves a real-world issue. I think it solves a real bug :) Commits ------- 2311437 [DI] Deprecate non-string default envs
…ers (ro0NL) This PR was merged into the 5.0-dev branch. Discussion ---------- [DI] remove support for non-string default env() parameters | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> See #27808 Commits ------- 614f5da [DI] remove support for non-string default env() parameters
Since Symfony 4.3 it is deprecated to use any non-string value for default env variable value symfony/symfony#27808
This is a failing test to further clarify the issues raised in #27680
So given #27680 (comment)
I think it solves a real bug :)