Skip to content

Commit 64d8136

Browse files
committed
Added a caution note about services that must maintain the "class" parameter
1 parent 60e0eec commit 64d8136

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

service_container/3.3-di-changes.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,14 @@ Start by updating the service ids to class names:
535535
app.api_client_sl_connect:
536536
# ...
537537
538+
.. caution::
539+
540+
Services associated with global PHP classes (i.e. not using PHP namespaces)
541+
must maintain the ``class`` parameter. For example, when using the old Twig
542+
classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``)
543+
you can't redefine the service as `Twig_Extensions_Extension_Intl: ~` and
544+
you must keep the original ``class`` parameter.
545+
538546
But, this change will break our app! The old service ids (e.g. ``app.github_notifier``)
539547
no longer exist. The simplest way to fix this is to find all your old service ids
540548
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/``
628636
+ AppBundle\:
629637
+ resource: '../../src/AppBundle/*'
630638
+ exclude: '../../src/AppBundle/{Entity,Repository}'
631-
+
639+
+
632640
+ AppBundle\Controller\:
633641
+ resource: '../../src/AppBundle/Controller'
634642
+ public: true

0 commit comments

Comments
 (0)