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 10
10
use function constant ;
11
11
use function in_array ;
12
12
use function is_string ;
13
+ use function method_exists ;
13
14
use function strlen ;
14
15
use function strpos ;
15
16
use function strtoupper ;
@@ -27,8 +28,14 @@ class Configuration implements ConfigurationInterface
27
28
*/
28
29
public function getConfigTreeBuilder () : TreeBuilder
29
30
{
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
+ }
32
39
33
40
$ organizeMigrationModes = $ this ->getOrganizeMigrationsModes ();
34
41
You can’t perform that action at this time.
0 commit comments