From 3bb392864775a94b780648e3566a21b037a11584 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 1 Feb 2018 09:46:03 +0100 Subject: [PATCH] Keep the services.yaml file in sync with the default Symfony file --- config/services.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/config/services.yaml b/config/services.yaml index 0e41a91b1..4a7a12ecc 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -9,15 +9,12 @@ parameters: services: # default configuration for services in *this* file _defaults: - # automatically injects dependencies in your services - autowire: true - # automatically registers your services as commands, event subscribers, etc. - autoconfigure: true - # this means you cannot fetch services directly from the container via $container->get() - # if you need to do this, you can override this setting on individual services - public: false - # defines the scalar arguments once and apply them to any service defined/created in this file - bind: + autowire: true # Automatically injects dependencies in your services. + autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. + public: false # Allows optimizing the container by removing unused services; this also means + # fetching services directly from the container via $container->get() won't work. + # The best practice is to be explicit about your dependencies anyway. + bind: # defines the scalar arguments once and apply them to any service defined/created in this file $locales: '%app_locales%' $defaultLocale: '%locale%' $emailSender: '%app.notifications.email_sender%' @@ -26,9 +23,13 @@ services: # this creates a service per class whose id is the fully-qualified class name App\: resource: '../src/*' - # you can exclude directories or files - # but if a service is unused, it's removed anyway - exclude: '../src/{Entity,Migrations,Tests}' + exclude: '../src/{Entity,Migrations,Tests,Kernel.php}' + + # controllers are imported separately to make sure services can be injected + # as action arguments even if you don't extend any base controller class + App\Controller\: + resource: '../src/Controller' + tags: ['controller.service_arguments'] # when the service definition only contains arguments, you can omit the # 'arguments' key and define the arguments just below the service class