Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Config] Allow using environment variables inEnumNode#45624
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
carsonbot commentedMar 3, 2022
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
ro0NL commentedMar 3, 2022
maybe reasonable 👍 (the reason behind current behavior is we cant assume env values always fit the enum) |
ecourtial commentedMar 3, 2022
What are the differences between the |
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
EnumNodeEnumNodeEnumNode… in EmumNode in 6.1 (ecourtial)This PR was merged into the 4.4 branch.Discussion----------Remove blocking test for adding support for placeholders in EmumNode in 6.1| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | no| Deprecations? | no| License | MIT| Doc PR | symfony/symfony-docs#... <!-- required for new features -->Remove blocking test for the PR#45624Commits-------a0bce33 Remove blocking test for adding support for placeholders in EmumNode in 6.1
fabpot commentedMar 9, 2022
Thank you@ecourtial. |
vince83110 commentedDec 28, 2022
For my curiosity, why you didn't rely on the enum error itself ? If the env value doesn't fit the enum, you throw a correct error explaining that the value doesn't fit the enum. It is a weird behavior, thanks for the PR. |
In theEnumNode of theConfig component, we see that it does not allow the use of a placeholder:
symfony/src/Symfony/Component/Config/Definition/EnumNode.php
Line 63 in5fbd0dc
This is strange, because we could have some use cases where we would like to be able to define the value with a env variable. A good example is the samesite policy for the session cookie :https://symfony.com/blog/new-in-symfony-4-2-samesite-cookie-configuration.
Note: I have not submitted any documentation update so far, I am not even sure it is a "new" feature.