@@ -9,15 +9,12 @@ parameters:
9
9
services :
10
10
# default configuration for services in *this* file
11
11
_defaults :
12
- # automatically injects dependencies in your services
13
- autowire : true
14
- # automatically registers your services as commands, event subscribers, etc.
15
- autoconfigure : true
16
- # this means you cannot fetch services directly from the container via $container->get()
17
- # if you need to do this, you can override this setting on individual services
18
- public : false
19
- # defines the scalar arguments once and apply them to any service defined/created in this file
20
- bind :
12
+ autowire : true # Automatically injects dependencies in your services.
13
+ autoconfigure : true # Automatically registers your services as commands, event subscribers, etc.
14
+ public : false # Allows optimizing the container by removing unused services; this also means
15
+ # fetching services directly from the container via $container->get() won't work.
16
+ # The best practice is to be explicit about your dependencies anyway.
17
+ bind : # defines the scalar arguments once and apply them to any service defined/created in this file
21
18
$locales : ' %app_locales%'
22
19
$defaultLocale : ' %locale%'
23
20
$emailSender : ' %app.notifications.email_sender%'
@@ -26,9 +23,13 @@ services:
26
23
# this creates a service per class whose id is the fully-qualified class name
27
24
App\ :
28
25
resource : ' ../src/*'
29
- # you can exclude directories or files
30
- # but if a service is unused, it's removed anyway
31
- exclude : ' ../src/{Entity,Migrations,Tests}'
26
+ exclude : ' ../src/{Entity,Migrations,Tests,Kernel.php}'
27
+
28
+ # controllers are imported separately to make sure services can be injected
29
+ # as action arguments even if you don't extend any base controller class
30
+ App\Controller\ :
31
+ resource : ' ../src/Controller'
32
+ tags : ['controller.service_arguments']
32
33
33
34
# when the service definition only contains arguments, you can omit the
34
35
# 'arguments' key and define the arguments just below the service class
0 commit comments