-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a note about inlined private services #3727
Added a note about inlined private services #3727
Conversation
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would emphasis "one": *one*
👍 (btw, if it applies to all versions, it should be merged into the 2.3 branch) |
service is used as argument for a single service
@wouterj added the emphasis on the one word. Indeed this should be applied to any 2.3+ branch. Sorry for having committed to the wrong branch again! |
|
||
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:`inlined-private-services` for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because there's no header immediately after the target, we have to include a label here, something like:
:ref:`Inline Private Services <inlined-private-services>` for more details.
Thanks Javier! |
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #3727). Discussion ---------- Added a note about inlined private services | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | 2.3+ | Fixed tickets | - When you define private services that are used just as arguments for another service, Symfon2 doesn't define them as services, but inlines them in the other service definition. This slightly improves the performance of the container, but it's confusing for Symfony beginners because the private services aren't displayed by the `container:debug` command even when using the `--show-private` option: ``` $ php app/console container:debug --show-private ``` Commits ------- 15a7be0 [book] [service_container] added the title of a cross reference 835b52f Emphasized the fact that this only applies when the private service is used as argument for a single service 04cb9d4 Added a note about inlined private services
When you define private services that are used just as arguments for another service, Symfon2 doesn't define them as services, but inlines them in the other service definition. This slightly improves the performance of the container, but it's confusing for Symfony beginners because the private services aren't displayed by the
container:debug
command even when using the--show-private
option: