@@ -226,8 +226,7 @@ Deprecating Services
226
226
The ``deprecated `` setting was introduced in Symfony 2.8.
227
227
228
228
Once you have decided to deprecate the use of a service (because it is outdated
229
- or you decided not to use and maintain it anymore), you can deprecate its
230
- definition:
229
+ or you decided not to maintain it anymore), you can deprecate its definition:
231
230
232
231
.. configuration-block ::
233
232
@@ -261,26 +260,25 @@ definition:
261
260
)
262
261
;
263
262
264
- Now, every time a service is created using this deprecated definition, a
265
- deprecation warning will be triggered, advising you to stop or to change your
266
- uses of that service.
263
+ Now, every time this service is used, a deprecation warning is triggered,
264
+ advising you to stop or to change your uses of that service.
267
265
268
- The message is actually a message template, which will replace occurrences
269
- of the ``%service_id% `` by the service's id. You **must ** have at least one
266
+ The message is actually a message template, which replaces occurrences of the
267
+ ``%service_id% `` placeholder by the service's id. You **must ** have at least one
270
268
occurrence of the ``%service_id% `` placeholder in your template.
271
269
272
270
.. note ::
273
271
274
- The deprecation message is optional. If not set, Symfony will show a default
275
- message ``The "%service_id%" service is deprecated. You should stop using it,
272
+ The deprecation message is optional. If not set, Symfony will show this default
273
+ message: ``The "%service_id%" service is deprecated. You should stop using it,
276
274
as it will soon be removed. ``.
277
275
278
276
.. tip ::
279
277
280
- It is strongly recommended that you fill the message template, to avoid a
281
- message that could be too generic such as the default one. A good message
282
- informs when this service was deprecated, and until when it will be
283
- maintained (look at the examples above ).
278
+ It is strongly recommended that you define a custom message because the
279
+ default one is too generic. A good message informs when this service was
280
+ deprecated, until when it will be maintained and the alternative services
281
+ to use (if any ).
284
282
285
283
For service decorators (see above), if the definition does not modify the
286
284
deprecated status, it will inherit the status from the definition that is
0 commit comments