Conditions | 2 |
Paths | 2 |
Total Lines | 27 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
24 | public function getConfigTreeBuilder() |
||
25 | { |
||
26 | $treeBuilder = new TreeBuilder('everlution_ajaxcom'); |
||
|
|||
27 | |||
28 | if (method_exists($treeBuilder, 'getRootNode')) { |
||
29 | $rootNode = $treeBuilder->getRootNode(); |
||
30 | } else { |
||
31 | // for symfony/config 4.1 and older |
||
32 | $rootNode = $treeBuilder->root('everlution_ajaxcom'); |
||
33 | } |
||
34 | |||
35 | $rootNode |
||
36 | ->children() |
||
37 | ->scalarNode(self::FLASH_TEMPLATE)->defaultValue('@EverlutionAjaxcom/flash_message.html.twig')->end() |
||
38 | ->scalarNode(self::FLASH_BLOCK_ID)->defaultValue('flash_message')->end() |
||
39 | ->scalarNode(self::PERSISTENT_CLASS)->defaultValue('ajaxcom-persistent')->end() |
||
40 | ->arrayNode(self::BLOCKS_TO_RENDER) |
||
41 | ->arrayPrototype() |
||
42 | ->children() |
||
43 | ->scalarNode(self::ID)->end() |
||
44 | ->scalarNode(self::REFRESH)->defaultFalse()->end() |
||
45 | ->end() |
||
46 | ->end() |
||
47 | ->end() |
||
48 | ->end(); |
||
49 | |||
50 | return $treeBuilder; |
||
51 | } |
||
53 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.