Skip to content

Commit 2f5ab24

Browse files
author
Hugo Hamon
committed
[app] simplify services configuration.
1 parent 5b04da5 commit 2f5ab24

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/config/services.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,17 @@ services:
5151
# In this example, the classes found in the following directories will be
5252
# automatically registered as services:
5353
#
54+
# * src/AppBundle/EventListener/
5455
# * src/AppBundle/Form/Type/
5556
# * src/AppBundle/Security/
5657
# * src/AppBundle/Twig/
5758
# * src/AppBundle/Utils/
5859
#
59-
# Thus, only the classes whose corresponding filename ends with the "Subscriber.php"
60-
# suffix in the src/AppBundle/EventListener/ directory will be registered as
61-
# services in the service container. Other classes of this directory will be simply
62-
# ignored.
60+
# The "resource" attribute can accept more specific glob patterns like
61+
# "{EventListener/*Subscriber.php,Form/Type/*Type.php}".
6362
AppBundle\:
6463
# Register all classes in the src/AppBundle directory as services
65-
resource: '../../src/AppBundle/{EventListener/*Subscriber.php,Form/Type,Security,Twig,Utils}'
64+
resource: '../../src/AppBundle/{EventListener,Form/Type,Security,Twig,Utils}'
6665

6766
# The other section defines a rule to automatically register and autowire the
6867
# controller classes found in the src/AppBundle/Controller/ directory.
@@ -116,7 +115,7 @@ services:
116115
# Those events are defined in the tags added to the service definition.
117116
# See http://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener
118117
AppBundle\EventListener\CommentNotificationListener:
119-
arguments: ['@mailer', '@router', '@translator', '%app.notifications.email_sender%']
118+
$sender: '%app.notifications.email_sender%'
120119
# The "method" attribute of this tag is optional and defaults to "on + camelCasedEventName"
121120
# If the event is "comment.created" the method executed by default is "onCommentCreated()".
122121
tags:

0 commit comments

Comments
 (0)