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 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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the RST format used in Symfony Docs, code uses two backticks instead of one (like in Markdown):

... ``AbstractController`` instead of ``Controller`` ...

your controllers, you can skip the rest of this step as `AbstractController` won't provide
a containe where you can get the services directly. All services need to be injected as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containe -> container

explained in `Step 5 Cleanup`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a link to an absolute URL, we can link to a specific part of this article. First, change the link of this line by this:

explained in the :ref:`step 5 of this article <step-5>`.

Then, in the line 718 of this article, add the following reference before Step 5) Cleanup!:

.. _step-5:

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

...

Finally, you can remove this link at the bottom of the article: .. _Step 5 Cleanup: https://github.com/symfony/symfony-docs/blob/master/service_container/3.3-di-changes.rst#step-5-cleanup


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 @@ -790,3 +797,5 @@ can be autowired. The final configuration looks like this:
You can now take advantage of the new features going forward.

.. _`FrameworkExtension for 3.3.0`: https://github.com/symfony/symfony/blob/7938fdeceb03cc1df277a249cf3da70f0b50eb98/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L247-L284

.. _`Step 5 Cleanup`: https://github.com/symfony/symfony-docs/blob/master/service_container/3.3-di-changes.rst#step-5-cleanup