Merge pull request #98 from antograssiot/patch-1

Avoid deprecation warning when using symfony/config >= 4.2
This commit is contained in:
Ryan Weaver 2019-01-03 13:46:37 -06:00 committed by GitHub
commit d2824faf99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,9 +14,11 @@ class Configuration implements ConfigurationInterface
*/ */
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
$treeBuilder = new TreeBuilder(); $treeBuilder = new TreeBuilder('knp_markdown');
// BC layer for symfony/config < 4.2
$rootNode = method_exists($treeBuilder, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('knp_markdown');
$treeBuilder->root('knp_markdown', 'array') $rootNode
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->arrayNode('parser') ->arrayNode('parser')