Skip to content

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

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions service_container/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,9 @@ Tagged Services with Priority

The ability to prioritize tagged services was introduced in Symfony 4.4.

The tagged services can be prioritized using the ``priority`` attribute,
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:
Copy link
Contributor

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?


.. configuration-block::

Expand Down Expand Up @@ -655,7 +656,7 @@ service itself::
}
}

If you want to have another method defining the priority
If you want to have another method defining the priority
(e.g. ``getPriority()`` rather than ``getDefaultPriority()``),
you can define it in the configuration of the collecting service:

Expand Down