Skip to content

Update 3.3-di-changes.rst #10313

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

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
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
9 changes: 9 additions & 0 deletions service_container/3.3-di-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,13 @@ Start by updating the service ids to class names:
account when looking up for services.
Furthermore it is always recommended to check for definition existence
using ``has()`` function.

.. note::

If you get rid of deprecations and extend ``AbstractController`` instead of ``Controller`` for
your controllers, you can skip the rest of this step as `AbstractController` won't provide a
container where you can get the services directly. All services need to be injected as explained
in the :ref:`step 5 of this article <step-5>`.

But, this change will break our app! The old service ids (e.g. ``app.github_notifier``)
no longer exist. The simplest way to fix this is to find all your old service ids
Expand Down Expand Up @@ -708,6 +715,8 @@ will be used. If you *don't* have this, the auto-registration feature will try t
register a third ``ApiClient`` service and use that for autowiring (which will fail,
because the class has a non-autowireable argument).

.. _step-5:

Step 5) Cleanup!
~~~~~~~~~~~~~~~~

Expand Down