Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 000b801

Browse filesBrowse files
Minor reword and fixes
1 parent 0aaf48b commit 000b801
Copy full SHA for 000b801

File tree

Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-9
lines changed

‎service_container/tags.rst

Copy file name to clipboardExpand all lines: service_container/tags.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,16 @@ Reference Tagged Services
410410
~~~~~~~~~~~~~~~~~~~~~~~~~
411411

412412
.. versionadded:: 3.4
413-
414413
Support for the tagged service notation in YAML, XML and PHP was introduced
415414
in Symfony 3.4.
416415

417-
If you use tags to inject a list of services as an argument, writing a compiler
418-
pass is a bit tedious. As this is a very common case, Symfony provides a way to
419-
inject all services tagged with a specific tag.
416+
Symfony provides a shortcut to inject all services tagged with a specific tag,
417+
which is a common need in some applications, so you don't have to write a
418+
compiler pass just for that. The only downside of this feature is that you can't
419+
have any custom attributes.
420420

421-
The downside of this feature is that you can't have any custom attributes. In the
422-
example below, all services tagged with ``app.handler`` are passed as first
423-
constructor argument to the ``App\HandlerCollection`` service:
421+
In the following example, all services tagged with ``app.handler`` are passed as
422+
first constructor argument to the ``App\HandlerCollection`` service:
424423

425424
.. configuration-block::
426425

@@ -475,7 +474,8 @@ constructor argument to the ``App\HandlerCollection`` service:
475474
// inject all services tagged with app.handler as first argument
476475
->addArgument(new TaggedIteratorArgument('app.handler'));
477476
478-
After compilation the ``HandlerCollection`` service is able to iterate over your application handlers.
477+
After compilation the ``HandlerCollection`` service is able to iterate over your
478+
application handlers.
479479

480480
.. code-block:: php
481481
@@ -488,7 +488,7 @@ After compilation the ``HandlerCollection`` service is able to iterate over your
488488
489489
.. tip::
490490

491-
The collected services can be prioritized using the `priority` attribute.
491+
The collected services can be prioritized using the ``priority`` attribute.
492492

493493
.. code-block:: yaml
494494

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.