Skip to content

Add note about not using autowire with ServiceSubscriber #20961

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

Open
wants to merge 4 commits into
base: 7.2
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions service_container/service_subscribers_locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ count and iterate over the services of the locator::
The :class:`Symfony\\Contracts\\Service\\ServiceCollectionInterface` was
introduced in Symfony 7.1.

Without autoconfiguration
~~~~~~~~~~~~~~~~~~~~~~~~~

If you are not using autoconfiguration you need to require either ``Psr\Container\ContainerInterface`` or ``Symfony\Contracts\Service\ServiceProviderInterface`` as a ``__construct`` argument or as a method call like ``setContainer(Psr\Container\ContainerInterface $container)``.

Including Services
------------------

Expand Down