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

[DependencyInjection] Fix ContainerBuilder stats env usage with enum #48502

Merged

Conversation

alamirault
Copy link
Contributor

Q A
Branch? 6.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #48498
License MIT
Doc PR symfony/symfony-docs#...

Without patch:

[
    'enum:Symfony\Component\DependencyInjection\Tests\Fixtures\StringBackedEnum:foo' => 0,
    'Bar' => 1,
]

With patch:

[
    'enum:Symfony\Component\DependencyInjection\Tests\Fixtures\StringBackedEnum:foo' => 1,
    'Bar' => 1,
]

@carsonbot carsonbot added this to the 6.2 milestone Dec 5, 2022
@OskarStark OskarStark changed the title [DependencyInjection] Fix ContainerBuilder stats env usage with enum [DependencyInjection] Fix ContainerBuilder stats env usage with enum Dec 5, 2022
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the test.
For reviewers, this regex was introduced by #47176

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex is also in MergeExtensionConfigurationPass.

@nicolas-grekas
Copy link
Member

Looking why we forgot that in #46564, I think the correct patch is to add \\ to the strtr on this line:
https://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php#L52

@nicolas-grekas nicolas-grekas force-pushed the hotfix/48498-fix-env-couting-enum branch from e70a80a to 75da869 Compare December 6, 2022 17:09
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I implemented the change I suggested)

@nicolas-grekas
Copy link
Member

Thank you @alamirault.

@nicolas-grekas nicolas-grekas merged commit ee94cc9 into symfony:6.2 Dec 6, 2022
@fabpot fabpot mentioned this pull request Dec 6, 2022
@alamirault
Copy link
Contributor Author

(I implemented the change I suggested)

Thanks Nicolas 😄

@alamirault alamirault deleted the hotfix/48498-fix-env-couting-enum branch December 6, 2022 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants