8000 Merge branch '5.4' into 6.3 · symfony/symfony-docs@6b82466 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b82466

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: - [Options Resolver] Using placeholder to use dynamic parameter
2 parents 19ec521 + a789e39 commit 6b82466

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/options_resolver.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,14 @@ method::
790790
->setDeprecated('hostname', 'acme/package', '1.2')
791791

792792
// you can also pass a custom deprecation message (%name% placeholder is available)
793+
// %name% placeholder will be replaced by the deprecated option.
794+
// This outputs the following deprecation message:
795+
// Since acme/package 1.2: The option "hostname" is deprecated, use "host" instead.
793796
->setDeprecated(
794797
'hostname',
795798
'acme/package',
796799
'1.2',
797-
'The option "hostname" is deprecated, use "host" instead.'
800+
'The option "%name%" is deprecated, use "host" instead.'
798801
)
799802
;
800803

@@ -811,6 +814,10 @@ method::
811814
:method:`Symfony\\Component\\OptionsResolver\\Options::offsetGet` method
812815
to not trigger the deprecation warning.
813816

817+
.. note::
818+
819+
All deprecation messages are displayed in the profiler logs in the "Deprecations" tab.
820+
814821
Instead of passing the message, you may also pass a closure which returns
815822
a string (the deprecation message) or an empty string to ignore the deprecation.
816823
This closure is useful to only deprecate some of the allowed types or values of

0 commit comments

Comments
 (0)
0