Skip to content

[DependencyInjection] Add a warning about tagged services needing to be after the glob definition #16888

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

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 9 additions & 2 deletions doctrine/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ with the ``doctrine.event_listener`` tag:
# config/services.yaml
services:
# ...

# It is very important that this definition goes after 'App\:' or it will get overwritten
App\EventListener\SearchIndexer:
tags:
-
Expand All @@ -206,6 +206,8 @@ with the ``doctrine.event_listener`` tag:
<!-- ... -->

<!--
It is very important that this definition goes after 'App\' or it will get overwritten

* 'event' is the only required option that defines the lifecycle listener
* 'priority': used when multiple subscribers or listeners are associated to the same event
* (default priority = 0; higher numbers = listener is run earlier)
Expand Down Expand Up @@ -293,6 +295,7 @@ with the ``doctrine.orm.entity_listener`` tag:
services:
# ...

# It is very important that this definition goes after 'App\:' or it will get overwritten
App\EventListener\UserChangedNotifier:
tags:
-
Expand Down Expand Up @@ -321,10 +324,11 @@ with the ``doctrine.orm.entity_listener`` tag:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:doctrine="http://symfony.com/schema/dic/doctrine">
<services>
<!-- ... -->
<!-- It is very important that this definition goes after 'App\' or it will get overwritten -->

<service id="App\EventListener\UserChangedNotifier">
<!--

* These are the options required to define the entity listener:
* * name
* * event
Expand Down Expand Up @@ -458,6 +462,7 @@ Doctrine connection to use) you must do that in the manual service configuration
services:
# ...

# It is very important that this definition goes after 'App\:' or it will get overwritten
App\EventListener\DatabaseActivitySubscriber:
tags:
- name: 'doctrine.event_subscriber'
Expand All @@ -479,6 +484,8 @@ Doctrine connection to use) you must do that in the manual service configuration
<!-- ... -->

<!--
It is very important that this definition goes after 'App\' or it will get overwritten

* 'priority': used when multiple subscribers or listeners are associated to the same event
* (default priority = 0; higher numbers = listener is run earlier)
* 'connection': restricts the listener to a specific Doctrine connection
Expand Down