| Conditions | 4 |
| Paths | 2 |
| Total Lines | 45 |
| Code Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 30 |
| CRAP Score | 4.0466 |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 1 | public function getConfigTreeBuilder(): TreeBuilder |
|
| 18 | { |
||
| 19 | 1 | $builder = new TreeBuilder(self::CONFIG_NAME); |
|
| 20 | 1 | $rootNode = method_exists($builder, 'getRootNode') |
|
| 21 | 1 | ? $builder->getRootNode() |
|
| 22 | 1 | : $builder->root(self::CONFIG_NAME) |
|
|
|
|||
| 23 | ; |
||
| 24 | |||
| 25 | $rootNode |
||
| 26 | 1 | ->children() |
|
| 27 | 1 | ->arrayNode('dictionaries') |
|
| 28 | 1 | ->useAttributeAsKey('name') |
|
| 29 | 1 | ->prototype('array') |
|
| 30 | 1 | ->beforeNormalization() |
|
| 31 | 1 | ->always() |
|
| 32 | 1 | ->then(function ($values) { |
|
| 33 | if (false === \array_key_exists('type', $values)) { |
||
| 34 | if (false === \array_key_exists('content', $values)) { |
||
| 35 | return ['type' => 'value', 'content' => $values]; |
||
| 36 | } |
||
| 37 | |||
| 38 | return array_merge($values, ['type' => 'value']); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $values; |
||
| 42 | 1 | }) |
|
| 43 | 1 | ->end() |
|
| 44 | 1 | ->children() |
|
| 45 | 1 | ->scalarNode('type')->defaultValue('value')->end() |
|
| 46 | 1 | ->scalarNode('extends')->end() |
|
| 47 | 1 | ->arrayNode('dictionaries') |
|
| 48 | 1 | ->normalizeKeys(false)->prototype('scalar')->end() |
|
| 49 | 1 | ->end() |
|
| 50 | 1 | ->arrayNode('content') |
|
| 51 | 1 | ->normalizeKeys(false)->prototype('scalar')->end() |
|
| 52 | 1 | ->end() |
|
| 53 | 1 | ->scalarNode('service')->end() |
|
| 54 | 1 | ->scalarNode('method')->end() |
|
| 55 | 1 | ->end() |
|
| 56 | 1 | ->end() |
|
| 57 | 1 | ->end() |
|
| 58 | 1 | ->end() |
|
| 59 | ; |
||
| 60 | |||
| 61 | 1 | return $builder; |
|
| 62 | } |
||
| 64 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.