diff --git a/service_container.rst b/service_container.rst index c52c29a3d3d..1c972f34076 100644 --- a/service_container.rst +++ b/service_container.rst @@ -571,6 +571,9 @@ But, you can control this and pass in a different logger: # explicitly configure the service App\Service\MessageGenerator: arguments: + # the '@' symbol is important: that's what tells the container + # you want to pass the *service* whose id is 'monolog.logger.request', + # and not just the *string* 'monolog.logger.request' $logger: '@monolog.logger.request' .. code-block:: xml @@ -612,13 +615,7 @@ For a full list of *all* possible services in the container, run: .. code-block:: terminal - php bin/console debug:container --show-private - -.. tip:: - - The ``@`` symbol is important: that's what tells the container you want to pass - the *service* whose id is ``monolog.logger.request``, and not just the *string* - ``monolog.logger.request``. + $ php bin/console debug:container .. _services-binding: diff --git a/service_container/debug.rst b/service_container/debug.rst index 9e00b322981..a477eddd67c 100644 --- a/service_container/debug.rst +++ b/service_container/debug.rst @@ -6,17 +6,17 @@ How to Debug the Service Container & List Services ================================================== You can find out what services are registered with the container using the -console. To show all services and the class for each service, run: +console. To show all services (public and private) and their PHP classes, run: .. code-block:: terminal $ php bin/console debug:container -By default, only public services are shown, but you can also view private services: + # add this option to display "hidden services" too (those whose ID starts with a dot) + $ php bin/console debug:container --show-hidden -.. code-block:: terminal - - $ php bin/console debug:container --show-private +.. versionadded:: 4.1 + Hidden services and the ``--show-hidden`` option were introduced in Symfony 4.1. To see a list of all of the available types that can be used for autowiring, run: