-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] CSV env var processor does not work like an ordinary array #40654
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
Comments
You are right. I see the problem. Would it be complicated to implementiert a checker, telling the developers that this combination of config and env is currently not supported, until there is a better solution? Because it took me some time to figure out were the problem comes from. |
i think the error message is the best hint we can generically provide currently :/ actually i think the right way to fix it is to make Im not sure what BC breaks it'll cause but conceptually it should do the trick. (i think "env placeholders" are special, and should not match "string values", even they technically are). Perhaps give it a try :) |
What I do not get is: why is an empty array used at placeholder for an env variable? wouldn't be a string better suited? |
the case where ifString() could return true, is in case the env is also type string at least. |
Closing as duplicate of #40906 |
Symfony version(s) affected: 5.2.6
Description
I am trying to setup monolog with a symfony_mailer handler. I want to configure the
to_email
with an ENV variable and usage of the csv processor so that I can add multiple receivers.How to reproduce
I have the
monolog.yaml
looking like that:And the
.env.local
looks like that:This results in an InvalidTypeException
When I replace the env var with a real array, for instance
the error is resolved. But as you can imagine this is no real solution.
I already have tried to figure out, what the problem is, but without real result. In Symfony's config definition
BaseNode
there is a normalizer method, which seem to replace the env variable with a nested array [[]] and this results in the error described above.If you need more details please tell me.
The text was updated successfully, but these errors were encountered: