@@ -43,6 +43,9 @@ service's class or interface name. Want to :doc:`log </logging>` something? No p
43
43
// ...
44
44
}
45
45
46
+ .. versionadded :: 3.3
47
+ The ability to type-hint a service in order to receive it was added in Symfony 3.3.
48
+
46
49
.. _container-debug-container :
47
50
48
51
What other services are available? Find out by running:
@@ -177,6 +180,10 @@ the service container *how* to instantiate it:
177
180
// app/config/services.php
178
181
// _defaults and loading entire directories is not possible with PHP configuration
179
182
183
+ .. versionadded :: 3.3
184
+ The ``_defaults `` key and ability to load services from a directory were added
185
+ in Symfony 3.3.
186
+
180
187
That's it! Thanks to the ``AppBundle\ `` line and ``resource `` key below it, a service
181
188
will be registered for each class in the ``src/AppBundle/Service `` directory (and
182
189
the other directories listed).
@@ -462,6 +469,11 @@ pass here. No problem! In your configuration, you can explicitly set this argume
462
469
->setPublic(false)
463
470
->setArgument('$adminEmail', 'manager@example.com');
464
471
472
+ .. versionadded :: 3.3
473
+ The ability to configure an argument by its name (``$adminEmail ``) was added
474
+ in Symfony 3.3. Previously, you could configure it only by its index (``2 `` in
475
+ this case).
476
+
465
477
Thanks to this, the container will pass ``manager@example.com `` as the third argument
466
478
to ``__construct `` when creating the ``SiteUpdateManager `` service. The other arguments
467
479
will still be autowired.
@@ -641,6 +653,9 @@ service whose id is ``monolog.logger.request``.
641
653
The autoconfigure Option
642
654
------------------------
643
655
656
+ .. versionadded :: 3.3
657
+ The ``autoconfigure `` option was added in Symfony 3.3.
658
+
644
659
Above, we've set ``autoconfigure: true `` in the ``_defaults `` section so that it
645
660
applies to all services defined in that file. With this setting, the container will
646
661
automatically apply certain configuration to your services, based on your service's
0 commit comments