Skip to content

Commit 93e158f

Browse files
authored
Update 3.3-di-changes.rst
Related to symfony#9676 (review)
1 parent 57d45cb commit 93e158f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

service_container/3.3-di-changes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ Start by updating the service ids to class names:
567567
classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``),
568568
  you can't redefine the service as ``Twig_Extensions_Extension_Intl: ~`` and
569569
you must keep the original ``class`` parameter.
570+
571+
.. caution::
572+
573+
If a service is processed by `Compiler Pass`_ you could face a "You have requested a non-existent service" error.
574+
To get rid of this, be sure that Compiler Pass is using ``findDefinition`` instead of ``getDefinition`` as the latter
575+
won't take aliases into account when looking up for services.
570576

571577
But, this change will break our app! The old service ids (e.g. ``app.github_notifier``)
572578
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:
778784
You can now take advantage of the new features going forward.
779785

780786
.. _`FrameworkExtension for 3.3.0`: https://github.com/symfony/symfony/blob/7938fdeceb03cc1df277a249cf3da70f0b50eb98/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L247-L284
787+
788+
.. _`Compiler Pass`: https://symfony.com/doc/current/service_container/compiler_passes.html

0 commit comments

Comments
 (0)