Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Lines | 21 |
Ratio | 100 % |
Tests | 8 |
CRAP Score | 2.0054 |
Changes | 0 |
1 | <?php |
||
20 | 2 | public function getConfigTreeBuilder() |
|
21 | { |
||
22 | 2 | $treeBuilder = new TreeBuilder('kunstmaan_form'); |
|
23 | 2 | if (method_exists($treeBuilder, 'getRootNode')) { |
|
24 | 2 | $rootNode = $treeBuilder->getRootNode(); |
|
25 | } else { |
||
26 | // BC layer for symfony/config 4.1 and older |
||
27 | $rootNode = $treeBuilder->root('kunstmaan_form'); |
||
28 | } |
||
29 | |||
30 | $rootNode |
||
31 | 2 | ->children() |
|
32 | 2 | ->booleanNode('deletable_formsubmissions')->defaultFalse()->end() |
|
33 | 2 | ->end() |
|
34 | ; |
||
35 | |||
36 | // Here you should define the parameters that are allowed to |
||
37 | // configure your bundle. See the documentation linked above for |
||
38 | // more information on that topic. |
||
39 | 2 | return $treeBuilder; |
|
40 | } |
||
41 | } |
||
42 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.