From fb93c9c907b885b9441a5c132be6a0a3845d16ab Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Mon, 10 Sep 2018 17:24:53 +0200 Subject: [PATCH 1/4] Update 3.3-di-changes.rst Looking at deprecations of 4.2, I noticed that extending `AbstractController` will prevent you from getting the services (even public ones) from container. This should be reported. --- service_container/3.3-di-changes.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 33a036413dc..8e74122aca5 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -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 + explained in `Step 5 Cleanup`_ 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 From fa5023e55385a18e8d95e641523d8c8ed05ab0ac Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Tue, 11 Sep 2018 11:10:10 +0200 Subject: [PATCH 2/4] Update 3.3-di-changes.rst --- service_container/3.3-di-changes.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 8e74122aca5..222f9eb450d 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -580,10 +580,10 @@ Start by updating the service ids to class names: .. 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 - explained in `Step 5 Cleanup`_ + 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 + container where you can get the services directly. All services need to be injected as explained + in the :ref:`step 5 of this 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 @@ -796,6 +796,4 @@ 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 +.. _`FrameworkExtension for 3.3.0`: https://github.com/symfony/symfony/blob/7938fdeceb03cc1df277a249cf3da70f0b50eb98/src/Symfony/Bundle/FrameworkBundle/Dependen From 54a0701e142bf5b072c2bc3629260cf844aaf413 Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Tue, 11 Sep 2018 11:12:03 +0200 Subject: [PATCH 3/4] Update 3.3-di-changes.rst --- service_container/3.3-di-changes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 222f9eb450d..5538e2313d0 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -796,4 +796,4 @@ 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/Dependen +.. _`FrameworkExtension for 3.3.0`: https://github.com/symfony/symfony/blob/7938fdeceb03cc1df277a249cf3da70f0b50eb98/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L247-L284 From 2be9e69f2fc5afd9ff096d722dac0b411b8e2f97 Mon Sep 17 00:00:00 2001 From: Samuele Lilli Date: Tue, 11 Sep 2018 14:53:07 +0200 Subject: [PATCH 4/4] Update 3.3-di-changes.rst --- service_container/3.3-di-changes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 5538e2313d0..6dfcd7fd5eb 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -715,6 +715,8 @@ will be used. If you *don't* have this, the auto-registration feature will try t register a third ``ApiClient`` service and use that for autowiring (which will fail, because the class has a non-autowireable argument). +.. _step-5: + Step 5) Cleanup! ~~~~~~~~~~~~~~~~