From 93e158f2b0efd27ca78150343a990683396779d6 Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Fri, 27 Apr 2018 09:58:29 +0200 Subject: [PATCH 1/3] Update 3.3-di-changes.rst Related to https://github.com/symfony/symfony-docs/pull/9676#pullrequestreview-115232548 --- service_container/3.3-di-changes.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 10529d5fa0f..1188788f385 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -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 + 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 From 8b0406f2cc68a60fb60a39a0e73467229faaf336 Mon Sep 17 00:00:00 2001 From: DonCallisto Date: Fri, 18 May 2018 08:34:21 +0200 Subject: [PATCH 2/3] PR request changes --- service_container/3.3-di-changes.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 1188788f385..b56e611b5bf 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -567,12 +567,16 @@ 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 - won't take aliases into account when looking up for services. + If a service is processed by :doc:`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 won't take aliases into + account when looking up for services. + Furthermore is always recommendend to check for definition existance + 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 @@ -784,5 +788,3 @@ 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 From e154d32438f05ba5280dd16046fe969fee320566 Mon Sep 17 00:00:00 2001 From: DonCallisto Date: Fri, 18 May 2018 08:42:56 +0200 Subject: [PATCH 3/3] Typo fixing --- service_container/3.3-di-changes.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index b56e611b5bf..914cc9a6aed 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -570,13 +570,13 @@ Start by updating the service ids to class names: .. caution:: - If a service is processed by :doc:`compiler pass ` + If a service is processed by a :doc:`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 won't take aliases into + To get rid of this, be sure that the Compiler Pass is using ``findDefinition()`` + instead of ``getDefinition()``. The latter won't take aliases into account when looking up for services. - Furthermore is always recommendend to check for definition existance - with ``has()`` function. + Furthermore it is always recommendend to check for definition existance + using ``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