-
-
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 2 commits
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 |
---|---|---|
|
@@ -568,6 +568,16 @@ Start by updating the service ids to class names: | |
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 :doc:`compiler pass </service_container/compiler_passes>` | ||
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()`` | ||
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. [...] that the compiler pass is [...] |
||
instead of ``getDefinition()`` as the latter won't take aliases into | ||
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. [...] |
||
account when looking up for services. | ||
Furthermore is always recommendend to check for definition existance | ||
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. [...] it is [...] 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. [...] existence using |
||
with ``has()`` function. | ||
|
||
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 | ||
and update them to the new class id: ``app.github_notifier`` to ``App\Service\GitHubNotifier``. | ||
|
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.
minor typo: [...] by a [...]
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.
and there should be a comma at the end of the line