Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DependencyInjection] Fix handling of repeated #[Autoconfigure] attributes #57298

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

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

alexandre-daubois
Copy link
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #56841
License MIT

When repeating #[Autoconfigure], arguments from all attributes are now used. If an option is defined multiple times in repeated attributes, the last attribute defined will sets value.

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.

I think there is a regression for tags, before they were all added and now only the last are configured.

@alexandre-daubois alexandre-daubois force-pushed the gh-56841 branch 4 times, most recently from 3917ac7 to 58f7e4b Compare June 4, 2024 07:28
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.

SGTM

@GromNaN GromNaN requested a review from nicolas-grekas June 4, 2024 07:38
@nicolas-grekas nicolas-grekas changed the title [DependencyInjection] Fix incorrect options overwriting when repeating #[Autoconfigure] on a service [DependencyInjection] Fix handling of repeated #[Autoconfigure] attributes Aug 20, 2024
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.

The fix was much simpler ;)
I pushed it and kept your test cases.

@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

@nicolas-grekas nicolas-grekas merged commit 5d8c854 into symfony:5.4 Aug 20, 2024
10 of 12 checks passed
@alexandre-daubois
Copy link
Member Author

I pushed it and kept your test cases.

I'll have a look at your solution. Thank you for taking care of this!

@alexandre-daubois alexandre-daubois deleted the gh-56841 branch August 20, 2024 09:55
This was referenced Aug 30, 2024
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.

4 participants