Skip to content

Added a caution note about services that must maintain the "class" parameter #7959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion service_container/3.3-di-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down Expand Up @@ -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
Expand Down