Skip to content

Commit 3bb3928

Browse files
committed
Keep the services.yaml file in sync with the default Symfony file
1 parent de0d0d5 commit 3bb3928

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

config/services.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ parameters:
99
services:
1010
# default configuration for services in *this* file
1111
_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
2118
$locales: '%app_locales%'
2219
$defaultLocale: '%locale%'
2320
$emailSender: '%app.notifications.email_sender%'
@@ -26,9 +23,13 @@ services:
2623
# this creates a service per class whose id is the fully-qualified class name
2724
App\:
2825
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']
3233

3334
# when the service definition only contains arguments, you can omit the
3435
# 'arguments' key and define the arguments just below the service class

0 commit comments

Comments
 (0)