From 1bb934969024768ed8269b9c908a40c18ae11972 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 15 May 2018 15:41:54 +0200 Subject: [PATCH 1/3] Document the hidden services and update debug:cotnainer docs --- service_container.rst | 11 ++++------- service_container/debug.rst | 11 ++++++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/service_container.rst b/service_container.rst index c52c29a3d3d..e4ddbcf82f5 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..b6d5cbec30f 100644 --- a/service_container/debug.rst +++ b/service_container/debug.rst @@ -6,17 +6,22 @@ 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: +Hidden services, those whose ID starts with a dot character (``.``) aren't +included by default in the output of this command. Add the ``--show-hidden`` +option to list them too: .. code-block:: terminal - $ php bin/console debug:container --show-private + $ php bin/console debug:container --show-hidden + +.. 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: From a08092cbb3ec3bb757f0d4e4481fbd2bba00a988 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 15 May 2018 15:43:28 +0200 Subject: [PATCH 2/3] - --- service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container.rst b/service_container.rst index e4ddbcf82f5..1c972f34076 100644 --- a/service_container.rst +++ b/service_container.rst @@ -571,7 +571,7 @@ 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 + # 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' From 9d3c0dd44a93ff7ffd21c26fd5dd949602812618 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 18 May 2018 17:27:57 +0200 Subject: [PATCH 3/3] Simplified --- service_container/debug.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/service_container/debug.rst b/service_container/debug.rst index b6d5cbec30f..a477eddd67c 100644 --- a/service_container/debug.rst +++ b/service_container/debug.rst @@ -12,12 +12,7 @@ console. To show all services (public and private) and their PHP classes, run: $ php bin/console debug:container -Hidden services, those whose ID starts with a dot character (``.``) aren't -included by default in the output of this command. Add the ``--show-hidden`` -option to list them too: - -.. code-block:: terminal - + # add this option to display "hidden services" too (those whose ID starts with a dot) $ php bin/console debug:container --show-hidden .. versionadded:: 4.1