Skip to content

Commit

Permalink
Merge pull request #54 from firstred/symfony5
Browse files Browse the repository at this point in the history
Fix Symfony 4.1 deprecations and possibly add Symfony 5 support
  • Loading branch information
winzou authored Nov 23, 2019
2 parents 3e924ab + f236fad commit 70a2e91
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ class Configuration implements ConfigurationInterface
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
if (\method_exists(TreeBuilder::class, 'getRootNode')) {
$treeBuilder = new TreeBuilder('winzou_state_machine');
$configNode = $treeBuilder->getRootNode();
} else {
$treeBuilder = new TreeBuilder();
$configNode = $treeBuilder->root('winzou_state_machine');
}

$configNode = $treeBuilder
->root('winzou_state_machine')
$configNode = $configNode
->useAttributeAsKey('name')
->prototype('array')
->children()
Expand Down

0 comments on commit 70a2e91

Please sign in to comment.