From fcca1cbb7ef4068d9c9a58686c28ab7bc2e3e845 Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Wed, 31 May 2017 13:38:34 +0200 Subject: [PATCH 1/2] Showcase short definition syntax --- app/config/services.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/config/services.yml b/app/config/services.yml index 5da4664dc..3d0bc0ac7 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -30,18 +30,17 @@ services: arguments: $emailSender: '%app.notifications.email_sender%' + # When your service definition only requires arguments to be specified, + # you can use a shorter syntax for these: AppBundle\Twig\AppExtension: - arguments: - $locales: '%app_locales%' + $locales: '%app_locales%' AppBundle\EventListener\CommentNotificationSubscriber: - arguments: - $sender: '%app.notifications.email_sender%' + $sender: '%app.notifications.email_sender%' AppBundle\EventListener\RedirectToPreferredLocaleSubscriber: - arguments: - $locales: '%app_locales%' - $defaultLocale: '%locale%' + $locales: '%app_locales%' + $defaultLocale: '%locale%' # needed for the localizeddate Twig filter Twig\Extensions\IntlExtension: ~ From f857b2f5f4451dde22cb074e74e45543290b4008 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 31 May 2017 21:15:24 +0200 Subject: [PATCH 2/2] Tweaked the help note --- app/config/services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config/services.yml b/app/config/services.yml index 3d0bc0ac7..bf7247ae1 100644 --- a/app/config/services.yml +++ b/app/config/services.yml @@ -30,8 +30,8 @@ services: arguments: $emailSender: '%app.notifications.email_sender%' - # When your service definition only requires arguments to be specified, - # you can use a shorter syntax for these: + # when the service definition only contains arguments, you can omit the + # 'arguments' key and define the arguments just below the service class AppBundle\Twig\AppExtension: $locales: '%app_locales%'