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
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,7 +364,7 @@ or you decided not to maintain it anymore), you can deprecate its definition:
364
364
365
365
<services>
366
366
<serviceid="App\Service\OldService">
367
-
<deprecated>The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.</deprecated>
367
+
<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>
368
368
</service>
369
369
</services>
370
370
</container>
@@ -380,9 +380,19 @@ or you decided not to maintain it anymore), you can deprecate its definition:
380
380
$services = $configurator->services();
381
381
382
382
$services->set(OldService::class)
383
-
->deprecate('The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.');
383
+
->deprecate(
384
+
'vendor-name/package-name',
385
+
'2.8',
386
+
'The "%service_id%" service is deprecated since vendor-name/package-name 2.8 and will be removed in 3.0.'
387
+
);
384
388
};
385
389
390
+
..versionadded::5.1
391
+
392
+
Starting from Symfony 5.1, the ``deprecated`` YAML option, the ``<deprecated>``
393
+
XML tag and the ``deprecate()`` PHP function require three arguments (the
394
+
package name, the version and the deprecation message).
395
+
386
396
Now, every time this service is used, a deprecation warning is triggered,
387
397
advising you to stop or to change your uses of that service.