Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,29 @@ has a certain value:
->end()
;

Deprecating the Option
----------------------

You can deprecate options using the
:method:`Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::setDeprecated`
method::

$rootNode
->children()
->integerNode('old_option')
// this outputs the following generic deprecation message:
// The child node "old_option" at path "..." is deprecated.
->setDeprecated()

// you can also pass a custom deprecation message (%node% and %path% placeholders are available):
->setDeprecated('The "%node%" option is deprecated. Use "new_config_option" instead.')
->end()
->end()
;

If you use the Web Debug Toolbar, these deprecation notices are shown when the
configuration is rebuilt.

Documenting the Option
----------------------

Expand Down