Skip to content
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

Minor rewordings for the "deprecated" service option #5807

Merged
merged 1 commit into from
Nov 5, 2015
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
24 changes: 11 additions & 13 deletions components/dependency_injection/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ Deprecating Services
The ``deprecated`` setting was introduced in Symfony 2.8.

Once you have decided to deprecate the use of a service (because it is outdated
or you decided not to use and maintain it anymore), you can deprecate its
definition:
or you decided not to maintain it anymore), you can deprecate its definition:

.. configuration-block::

Expand Down Expand Up @@ -261,26 +260,25 @@ definition:
)
;

Now, every time a service is created using this deprecated definition, a
deprecation warning will be triggered, advising you to stop or to change your
uses of that service.
Now, every time this service is used, a deprecation warning is triggered,
advising you to stop or to change your uses of that service.

The message is actually a message template, which will replace occurrences
of the ``%service_id%`` by the service's id. You **must** have at least one
The message is actually a message template, which replaces occurrences of the
``%service_id%`` placeholder by the service's id. You **must** have at least one
occurrence of the ``%service_id%`` placeholder in your template.

.. note::

The deprecation message is optional. If not set, Symfony will show a default
message ``The "%service_id%" service is deprecated. You should stop using it,
The deprecation message is optional. If not set, Symfony will show this default
message: ``The "%service_id%" service is deprecated. You should stop using it,
as it will soon be removed.``.

.. tip::

It is strongly recommended that you fill the message template, to avoid a
message that could be too generic such as the default one. A good message
informs when this service was deprecated, and until when it will be
maintained (look at the examples above).
It is strongly recommended that you define a custom message because the
default one is too generic. A good message informs when this service was
deprecated, until when it will be maintained and the alternative services
to use (if any).

For service decorators (see above), if the definition does not modify the
deprecated status, it will inherit the status from the definition that is
Expand Down