-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update 3.3-di-changes.rst #9695
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
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 |
---|---|---|
|
@@ -567,6 +567,12 @@ Start by updating the service ids to class names: | |
classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``), | ||
you can't redefine the service as ``Twig_Extensions_Extension_Intl: ~`` and | ||
you must keep the original ``class`` parameter. | ||
|
||
.. caution:: | ||
|
||
If a service is processed by `Compiler Pass`_ you could face a "You have requested a non-existent service" error. | ||
To get rid of this, be sure that Compiler Pass is using ``findDefinition`` instead of ``getDefinition`` as the latter | ||
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. I would use 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. We could also add a note that it is generally a good idea to check with |
||
won't take aliases into account when looking up for services. | ||
|
||
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 | ||
|
@@ -778,3 +784,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 | ||
|
||
.. _`Compiler Pass`: https://symfony.com/doc/current/service_container/compiler_passes.html | ||
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. we should use the If a service is processed by a :doc:`compiler pass </service_container/compiler_passes>` [...] |
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.
We usually split lines after the first word that crosses the 72nd character.