Skip to content

Conversation

@alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Nov 6, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues #59088 (comment)
License MIT

More reviewable without whitespaces

…e registration and ignoring `container.ignore_attributes`
$reflector = null !== $class ? $container->getReflectionClass($class) : null;
$checkTaggedItem = !$definition->hasTag($definition->isAutoconfigured() ? 'container.ignore_attributes' : $tagName);

foreach ($attributes as $attribute) {
Copy link
Member

Choose a reason for hiding this comment

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

This loop is about looping over the various tags added explicitly in the service definition. Anything that skips this loop is broken by design. Explicit tag attributes must win over the AsTaggedItem attribute providing autoconfigured fallback values (see the priority of values in PriorityTaggedServiceUtil::getDefault())

@nicolas-grekas
Copy link
Member

Thanks but as explained by @stof, this doesn't fix the issue. I submitted #62329 instead.

nicolas-grekas added a commit that referenced this pull request Nov 12, 2025
…ggeditem] (nicolas-grekas)

This PR was merged into the 7.3 branch.

Discussion
----------

[DependencyInjection] Fix merging explicit tags and #[AsTaggeditem]

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #59088 (comment)
| License       | MIT

Instead of #62327

Commits
-------

e31b192 [DependencyInjection] Fix merging explicit tags and #[AsTaggeditem]
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