Skip to content

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Nov 7, 2025

Q A
Branch? 8.1
Bug fix? no
New feature? yes
Deprecations? yes
Issues -
License MIT

The is deprecating getDefaultFooName() methods and $defaultIndexMethod arguments used to build tagged iterators/locators (and alike for priorities).

These have been supersceded by #[AsTaggedItem] attributes, which are available since Symfony 5.3.

It was about time. Deprecating these will reduce complexity of the code, and of the doc!

We could also deprecate #[AsTaggedItem] in favor of #[AutoconfigureTag] at some point but this needs dedicated thoughts.
See #48532 for some background on this idea.

@nicolas-grekas nicolas-grekas force-pushed the di-tagged-default-method-deprec branch from 2677a0a to 9b40d76 Compare November 7, 2025 17:24
@nicolas-grekas
Copy link
Member Author

Status: needs work

The last commit fixes the tests but needs close review / refactoring of mine (it's LLM generated for now)

@stof
Copy link
Member

stof commented Nov 7, 2025

I don't think the amount of code simplification brought by that feature is worth adding new deprecations so late in the process.
AFAIK, our rule so far was that no new deprecations would be added once the first beta was tagged, to give time to the ecosystem to catch up. If we keep adding deprecations until the very last moment, projects might not be comfortable adding support for Symfony 8.0 in their composer requirement during that beta phase (as they might not be compatible with the stable version if we deprecate and remove something else), which hurts the community adoption of the beta versions of new major versions.

@nicolas-grekas nicolas-grekas force-pushed the di-tagged-default-method-deprec branch from 9b40d76 to b38d2ae Compare November 14, 2025 15:22
@nicolas-grekas nicolas-grekas modified the milestones: 7.4, 8.1 Nov 16, 2025
@nicolas-grekas nicolas-grekas force-pushed the di-tagged-default-method-deprec branch from b38d2ae to b2a8a19 Compare December 15, 2025 13:35
@nicolas-grekas
Copy link
Member Author

PR rebased to target 8.1

We could also deprecate #[AsTaggedItem] in favor of #[AutoconfigureTag] at some point but this needs dedicated thoughts.
See #48532 for some background on this idea.

Status: needs review

@stof
Copy link
Member

stof commented Dec 15, 2025

@nicolas-grekas those are doing separate things. #[AutoconfigureTag] creates an autoconfiguration rule that applies to all instances being a subtype of the class/interface on which it is applied, which has very different effect that AsTaggedItem as applied on classes that are extended.

@nicolas-grekas
Copy link
Member Author

@stof I get what you mean. What about the current PR? 👍 ? :)

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.

3 participants