File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -801,11 +801,14 @@ method::
801801 ->setDeprecated('hostname', 'acme/package', '1.2')
802802
803803 // you can also pass a custom deprecation message (%name% placeholder is available)
804+ // %name% placeholder will be replaced by the deprecated option.
805+ // This outputs the following deprecation message:
806+ // Since acme/package 1.2: The option "hostname" is deprecated, use "host" instead.
804807 ->setDeprecated(
805808 'hostname',
806809 'acme/package',
807810 '1.2',
808- 'The option "hostname " is deprecated, use "host" instead.'
811+ 'The option "%name% " is deprecated, use "host" instead.'
809812 )
810813 ;
811814
@@ -822,6 +825,10 @@ method::
822825 :method: `Symfony\\ Component\\ OptionsResolver\\ Options::offsetGet ` method
823826 to not trigger the deprecation warning.
824827
828+ .. note ::
829+
830+ All deprecation messages are displayed in the profiler logs into Deprecations tab.
831+
825832Instead of passing the message, you may also pass a closure which returns
826833a string (the deprecation message) or an empty string to ignore the deprecation.
827834This closure is useful to only deprecate some of the allowed types or values of
You can’t perform that action at this time.
0 commit comments