Skip to content
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

[DI] XmlDumper looses parameters types while dumping #34689

Closed
andrew-demb opened this issue Nov 28, 2019 · 1 comment
Closed

[DI] XmlDumper looses parameters types while dumping #34689

andrew-demb opened this issue Nov 28, 2019 · 1 comment

Comments

@andrew-demb
Copy link
Contributor

Symfony version(s) affected: 4.4.0

Description

XmlDumper doesn't preserve container parameter types.
Use any numeric-like parameter in container parameter value leads to have loaded value type float|int from xml cache.

How to reproduce

Use parameter with value something like '+1238523'.
Expected loaded value: string(8) "+1238523"
Actual loaded value: double(1238523)

Reproducer:
https://gist.github.com/andrew-demb/02c8487cd1a457f3d37d20c7afedd76c

Possible Solution

Support more cases here and set needed type attribute.
https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L316-L320

Additional context

@xabbuh
Copy link
Member

xabbuh commented Nov 29, 2019

see #34716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants