-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Update 3.3-di-changes.rst #10313
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 containe where you can get the services directly. All services need to be injected as | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
explained in `Step 5 Cleanup`_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Step 5) Cleanup!
~~~~~~~~~~~~~~~~
... Finally, you can remove this link at the bottom of the article: |
||
|
||
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 | ||
|
@@ -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 |
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.
In the RST format used in Symfony Docs, code uses two backticks instead of one (like in Markdown):