Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

Avoid deprecation warning when using symfony/config >= 4.2 #98

Merged
merged 1 commit into from
Jan 3, 2019
Merged
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
6 changes: 4 additions & 2 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -14,9 +14,11 @@ class Configuration implements ConfigurationInterface
*/
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()
->children()
->arrayNode('parser')