File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1010use function constant ;
1111use function in_array ;
1212use function is_string ;
13+ use function method_exists ;
1314use function strlen ;
1415use function strpos ;
1516use function strtoupper ;
@@ -27,8 +28,14 @@ class Configuration implements ConfigurationInterface
2728 */
2829 public function getConfigTreeBuilder () : TreeBuilder
2930 {
30- $ treeBuilder = new TreeBuilder ();
31- $ rootNode = $ treeBuilder ->root ('doctrine_migrations ' , 'array ' );
31+ $ treeBuilder = new TreeBuilder ('doctrine_migrations ' );
32+
33+ if (method_exists ($ treeBuilder , 'getRootNode ' )) {
34+ $ rootNode = $ treeBuilder ->getRootNode ();
35+ } else {
36+ // BC layer for symfony/config 4.1 and older
37+ $ rootNode = $ treeBuilder ->root ('doctrine_migrations ' , 'array ' );
38+ }
3239
3340 $ organizeMigrationModes = $ this ->getOrganizeMigrationsModes ();
3441
You can’t perform that action at this time.
0 commit comments