File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Symfony \Component \Config \Definition \Builder \TreeBuilder ;
66use Symfony \Component \Config \Definition \ConfigurationInterface ;
7+ use Symfony \Component \HttpKernel \Kernel ;
78
89/**
910 * This is the class that validates and merges configuration from the app/config files
@@ -16,13 +17,14 @@ class Configuration implements ConfigurationInterface
1617 */
1718 public function getConfigTreeBuilder ()
1819 {
19- /*
20- * symfony 4.3 version
21- * $treeBuilder = new TreeBuilder('fp_js_form_validator');
22- * $rootNode = $treeBuilder->getRootNode();
23- */
24- $ treeBuilder = new TreeBuilder ();
25- $ rootNode = $ treeBuilder ->root ('fp_js_form_validator ' );
20+ // A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
21+ if (Kernel::VERSION_ID < 40212 ) {
22+ $ treeBuilder = new TreeBuilder ();
23+ $ rootNode = $ treeBuilder ->root ('fp_js_form_validator ' );
24+ } else {
25+ $ treeBuilder = new TreeBuilder ('fp_js_form_validator ' );
26+ $ rootNode = $ treeBuilder ->getRootNode ();
27+ }
2628
2729 /** @noinspection PhpUndefinedMethodInspection */
2830 $ rootNode
You can’t perform that action at this time.
0 commit comments