Skip to content

[DependencyInjection] Private service definition documentation is not clear enough #4524

Closed
@jakzal

Description

@jakzal

Ocasionally we're getting reports like symfony/symfony#12588 or symfony/symfony#2586.

I think the Advanced DI chapter should emphasise more the fact that a private service is a hint for the container, and the rule is not enforced when retrieving the service from container. The doc currently says "Now that the service is private, you cannot call: $container->get('foo')", but few paragraphs before there's a note mentioning that a service is only inlined if it's referenced by a single service.

Partly related to #4228

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependencyInjectionWaiting feedbackactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions