Skip to content

Commit 8b0a921

Browse files
committed
minor #14513 Add priority order explanation for tagged services (hermann8u)
This PR was submitted for the 5.1 branch but it was squashed and merged into the 4.4 branch instead. Discussion ---------- Add priority order explanation for tagged services 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 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 958aeaf Add priority order explanation for tagged services
2 parents 15a3220 + 958aeaf commit 8b0a921

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

service_container/tags.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ Tagged Services with Priority
596596

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

599-
The tagged services can be prioritized using the ``priority`` attribute,
600-
thus providing a way to inject a sorted collection of services:
599+
The tagged services can be prioritized using the ``priority`` attribute.
600+
The priority is a positive or negative integer. The higher the number,
601+
the earlier the tagged service will be located in the collection:
601602

602603
.. configuration-block::
603604

@@ -655,7 +656,7 @@ service itself::
655656
}
656657
}
657658

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

0 commit comments

Comments
 (0)