Skip to content

Commit 6d68add

Browse files
committed
Showcase short definition syntax
1 parent a99f756 commit 6d68add

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

app/config/services.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,17 @@ services:
3030
arguments:
3131
$emailSender: '%app.notifications.email_sender%'
3232

33+
# When your service definition only requires arguments to be specified,
34+
# you can use a shorter syntax for these:
3335
AppBundle\Twig\AppExtension:
34-
arguments:
35-
$locales: '%app_locales%'
36+
$locales: '%app_locales%'
3637

37-
AppBundle\EventListener\CommentNotificationSubscriber:
38-
arguments:
39-
$sender: '%app.notifications.email_sender%'
38+
# The short syntax can also be inlined:
39+
AppBundle\EventListener\CommentNotificationSubscriber: { $sender: '%app.notifications.email_sender%' }
4040

4141
AppBundle\EventListener\RedirectToPreferredLocaleSubscriber:
42-
arguments:
43-
$locales: '%app_locales%'
44-
$defaultLocale: '%locale%'
42+
$locales: '%app_locales%'
43+
$defaultLocale: '%locale%'
4544

4645
# needed for the localizeddate Twig filter
47-
Twig\Extensions\IntlExtension: ~
46+
Twig\Extensions\IntlExtension: ~ # same as []

0 commit comments

Comments
 (0)