Skip to content

Commit

Permalink
bug #97 Fix forward compatibility with Symfony 5 (sstok)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.0-dev branch.

Discussion
----------

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| License       | MIT

Commits
-------

d4014f6 Fix forward compatibility with Symfony 5
  • Loading branch information
sstok authored Apr 14, 2019
2 parents 01fe996 + d4014f6 commit b37eebf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('rollerworks_password_strength');
$rootNode = $treeBuilder->root('rollerworks_password_strength'); // BC for Symfony < 4.2

if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC for Symfony < 4.2
$rootNode = $treeBuilder->root('rollerworks_password_strength');
}

$rootNode
->addDefaultsIfNotSet()
Expand Down

0 comments on commit b37eebf

Please sign in to comment.