-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add priority order explanation for tagged services #14513
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I think this makes a lot of sense.
I've suggested a minor move of the text. If you aren't able to make the chance, don't worry! We can do it while merging.
Awesome. This is really helpful. I remember that I've started making a PR once just enable a priority on tagged listeners... but then realising it is already implemented. |
Thank you for your feedbacks :) I have commit your suggestion too. |
3108c5c
to
958aeaf
Compare
Thank you Florian and congrats on your first Symfony Docs contribution! |
thus providing a way to inject a sorted collection of services: | ||
The tagged services can be prioritized using the ``priority`` attribute. | ||
The priority is a positive or negative integer. The higher the number, | ||
the earlier the tagged service will be located in the collection: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to mention the default priority here?
Hi,
In this page, the priority order is not explained for tagged services. Since I needed to know this, I guess it is a good addition.
The text is mostly inspired by the paragraph about priority in the event dispatcher documentation : https://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener
Fell free to edit it or to provide me some advices to do it.
Regards