diff --git a/book/service_container.rst b/book/service_container.rst index a036a6cae41..29248f6d60b 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1001,6 +1001,13 @@ By default only public services are shown, but you can also view private service $ php app/console container:debug --show-private +.. note:: + + If a private service is only used as an argument to just *one* other service, + it won't be displayed by the ``container:debug`` command, even when using + the ``--show-private`` option. See :ref:`Inline Private Services ` + for more details. + You can get more detailed information about a particular service by specifying its id: diff --git a/components/dependency_injection/advanced.rst b/components/dependency_injection/advanced.rst index 7c139a7b734..db5fa9a04b2 100644 --- a/components/dependency_injection/advanced.rst +++ b/components/dependency_injection/advanced.rst @@ -18,6 +18,8 @@ However, there are use-cases when you don't want a service to be public. This is common when a service is only defined because it could be used as an argument for another service. +.. _inlined-private-services: + .. note:: If you use a private service as an argument to only one other service,