I have the following setup which appeared to work for some time: environment variables like TEST=1 and defined defaults in parameters.yml, according to the config:
parameters:
env(TEST): 2
When I go to console and output the container params, it's always the value from parameters.yaml:
bin/console debug:container --parameters | grep env
env(TEST) 2
I also tried doing exactly as it's said in the docs:
TEST: "%env(TEST)%"
env(TEST): 2
Now when I dump the parameters, I have both of them:
bin/console debug:container --parameters | grep env
TEST %env(TEST)%
env(TEST) 2
To be more precise: I use docker setup, and printenv inside a container gives me my TEST=1 shown.
Can someone explain me what happens/happened here? It's been working for some time, and then, probably after some major update, got broken.
I tried debugging it and got to a very strange place in Symfony sources: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/ContainerBuilder.php#L1416
At that very line, there's a value "2" being passed, and it doesn't meet the conditions and gets returned.