File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,23 @@ accessor methods for parameters::
607
607
To learn more about compiling the container see
608
608
:doc: `/components/dependency_injection/compilation `.
609
609
610
+It is also possible to deprecate a container parameter. This is particularly useful
611
+ if you're writing your own package and want to warn developers to not use a parameter anymore
612
+ because it will be removed in one of the next version of your package.
613
+ Deprecating a container parameter can be done as follow::
614
+
615
+ $container->deprecateParameter(
616
+ 'vendor.database_user',
617
+ 'vendor-name/package-name',
618
+ '1.3',
619
+ // optionally you can set a custom deprecation message
620
+ '"vendor.database_user" is deprecated, you should configure database credentials in "vendor.database_dsn" parameter instead.'
621
+ );
622
+
623
+ .. versionadded :: 6.3
624
+
625
+ The ``ContainerBuilder::deprecateParameter `` method was introduced in Symfony 6.3.
626
+
610
627
.. _services-wire-specific-service :
611
628
612
629
Choose a Specific Service
You can’t perform that action at this time.
0 commit comments