Skip to content

Conversation

@stof
Copy link
Collaborator

@stof stof commented Jun 13, 2025

By using the core features of Symfony, we benefit of modern features like using #[AsTaggedItem] to define the priority of services for sorting or the index (for the case of the service locator for renderers).

Factory extensions are still processed using our existing logic (which does not support #[AsTaggedItem]) because the priority is needed in the KnpMenu library to perform runtime sorting, instead of being a build-time sorting of the injected iterable.

stof added 3 commits June 13, 2025 21:13
Letting Symfony process the collection of voters to build the
`IteratorArgument` in the definition gives us all the features available
in recent Symfony versions, while our own processing logic was not
implementing them. For instance, this gives us support for the
`[AsTaggedItem]` attribute as a way to specify the priority of the
voter, which is great when using autoconfiguration.
This brings support for `#[AsTaggedItem]` to define the index.
The compiler pass is now only responsible for detecting whether we need
to use the ChainProvider or no, but does not handle the configuration of
the ChainProvider anymore.
@stof stof requested a review from garak June 13, 2025 19:50
@stof stof merged commit eabe078 into KnpLabs:master Jun 14, 2025
10 checks passed
@stof stof deleted the better_registration branch June 14, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants