From b857caf1a4e5abdc1a55bd62a636a89ddfcf0ae8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sun, 28 May 2017 20:44:32 +0200 Subject: [PATCH 1/2] Added a caution note about services that must maintain the "class" parameter --- service_container/3.3-di-changes.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 3a8b072dd24..0d750d58990 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -535,6 +535,14 @@ Start by updating the service ids to class names: app.api_client_sl_connect: # ... +.. caution:: + + Services associated with global PHP classes (i.e. not using PHP namespaces) + must maintain the ``class`` parameter. For example, when using the old Twig + 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. + 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 ``AppBundle\Service\GitHubNotifier``. @@ -628,7 +636,7 @@ You're now ready to automatically register all services in ``src/AppBundle/`` + AppBundle\: + resource: '../../src/AppBundle/*' + exclude: '../../src/AppBundle/{Entity,Repository}' - + + + + AppBundle\Controller\: + resource: '../../src/AppBundle/Controller' + public: true From 4219a5e386aec527a3e6f9b24e730b0f14a74d7d Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Tue, 25 Jul 2017 19:36:26 +0200 Subject: [PATCH 2/2] minor fix --- service_container/3.3-di-changes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index 0d750d58990..c5b5cff3e44 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -539,8 +539,8 @@ Start by updating the service ids to class names: Services associated with global PHP classes (i.e. not using PHP namespaces) must maintain the ``class`` parameter. For example, when using the old Twig - classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``) - you can't redefine the service as `Twig_Extensions_Extension_Intl: ~` and + 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. But, this change will break our app! The old service ids (e.g. ``app.github_notifier``)