You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: service_container/alias_private.rst
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -342,7 +342,10 @@ or you decided not to maintain it anymore), you can deprecate its definition:
342
342
343
343
# config/services.yaml
344
344
App\Service\OldService:
345
-
deprecated: The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.
345
+
deprecated:
346
+
package: 'vendor-name/package-name'
347
+
version: '2.8'
348
+
message: The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.
346
349
347
350
.. code-block:: xml
348
351
@@ -354,7 +357,7 @@ or you decided not to maintain it anymore), you can deprecate its definition:
354
357
355
358
<services>
356
359
<serviceid="App\Service\OldService">
357
-
<deprecated>The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.</deprecated>
360
+
<deprecatedpackage="vendor-name/package-name"version="2.8">The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.</deprecated>
358
361
</service>
359
362
</services>
360
363
</container>
@@ -370,9 +373,19 @@ or you decided not to maintain it anymore), you can deprecate its definition:
370
373
$services = $configurator->services();
371
374
372
375
$services->set(OldService::class)
373
-
->deprecate('The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.');
376
+
->deprecate(
377
+
'vendor-name/package-name',
378
+
'2.8',
379
+
'The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.'
380
+
);
374
381
};
375
382
383
+
.. versionadded:: 5.1
384
+
385
+
Starting from Symfony 5.1, the ``deprecated`` YAML option, the ``<deprecated>``
386
+
XML tag and the ``deprecate()`` PHP function require three arguments (the
387
+
package name, the version and the deprecation message).
388
+
376
389
Now, every time this service is used, a deprecation warning is triggered,
377
390
advising you to stop or to change your uses of that service.
0 commit comments