-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Regression of YAML !php/const: prefix in Symfony v6.2.0-BETA2 config #48135
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
A regression compared to which version ? Note that the right syntax is |
it works indeed with somehow https://symfony.com/blog/new-in-symfony-3-2-php-constants-in-yaml-files eg uses both |
Yes, with a comment explaining that on Symfony 3.4 onwards, you should use the notation without |
Thanks, my bad However it is strange that support for |
Yeah, me too. If this notation has really still worked in 6.1 and possibly 5.x as well, we should consider treating this issue as a regression. |
@guillaumesmo Can you create a small example application using 6.1 where this works? |
In this example I used the prefix in a simple parameter, and it also fails there, so the issue is not limited to doctrine config.
With Symfony 6.0/6.1 I get the following: With Symfony 6.2-BETA2 I get this error: |
It should be possible to improve the exception message, to suggest the correct syntax. |
@GromNaN it is deprecated since 3.x ... but now it's a bc break. Shouldn't we now support the |
Symfony version(s) affected
v6.2.0-BETA2
Description
In Symfony v6.2.0-BETA2, I'm unable to use the YAML !php/const: prefix in doctrine config
Previously, you could do this:
In Symfony v6.2.0-BETA2, I get the following error:
Invalid type for path "doctrine.dbal.connections.default.options". Expected "array", but got "Symfony\Component\Yaml\Tag\TaggedValue"
Although there's a simple workaround I wonder if it doesn't affect configuration in other places/cases, which is why I report it
How to reproduce
Add the following config in doctrine.yaml:
In Symfony v6.2.0-BETA2, I get the following error:
Invalid type for path "doctrine.dbal.connections.default.options". Expected "array", but got "Symfony\Component\Yaml\Tag\TaggedValue"
Workaround is to use the constant value instead
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: