8000 minor #7794 [config] Add a note about deprecated a node (sanpii, javi… · symfony/symfony-docs@f8ddf1f · GitHub
[go: up one dir, main page]

Skip to content

Commit f8ddf1f

Browse files
committed
minor #7794 [config] Add a note about deprecated a node (sanpii, javiereguiluz)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #7794). Discussion ---------- [config] Add a note about deprecated a node Documentation for symfony/symfony#22382 Commits ------- 1939371 Explained the possibility of defining custom deprecation messages d6a8624 [config] Add a note about deprecated a node
2 parents c3c6772 + 1939371 commit f8ddf1f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

components/config/definition.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,29 @@ has a certain value:
424424
->end()
425425
;
426426
427+
Deprecating the Option
428+
----------------------
429+
430+
You can deprecate options using the
431+
:method:`Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::setDeprecated`
432+
method::
433+
434+
$rootNode
435+
->children()
436+
->integerNode('old_option')
437+
// this outputs the following generic deprecation message:
438+
// The child node "old_option" at path "..." is deprecated.
439+
->setDeprecated()
440+
441+
// you can also pass a custom deprecation message (%node% and %path% placeholders are available):
442+
->setDeprecated('The "%node%" option is deprecated. Use "new_config_option" instead.')
443+
->end()
444+
->end()
445+
;
446+
447+
If you use the Web Debug Toolbar, these deprecation notices are shown when the
448+
configuration is rebuilt.
449+
427450
Documenting the Option
428451
----------------------
429452

0 commit comments

Comments
 (0)
0