We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 1 |
Paths | 1 |
Total Lines | 70 |
Code Lines | 65 |
Lines | 0 |
Ratio | 0 % |
Tests | 63 |
CRAP Score | 1 |
Changes | 11 | ||
Bugs | 0 | Features | 6 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
35 | public function getConfigTreeBuilder() |
||
36 | 36 | { |
|
37 | 36 | $treeBuilder = new TreeBuilder(); |
|
38 | $rootNode = $treeBuilder->root('overblog_graphql'); |
||
39 | |||
40 | 36 | $rootNode |
|
41 | 36 | ->children() |
|
42 | 36 | ->arrayNode('definitions') |
|
43 | 36 | ->addDefaultsIfNotSet() |
|
44 | 36 | ->children() |
|
45 | 36 | ->scalarNode('internal_error_message')->defaultNull()->end() |
|
46 | 36 | ->booleanNode('config_validation')->defaultValue($this->debug)->end() |
|
47 | 36 | ->arrayNode('schema') |
|
48 | 36 | ->addDefaultsIfNotSet() |
|
49 | 36 | ->children() |
|
50 | 36 | ->scalarNode('query')->defaultNull()->end() |
|
51 | 36 | ->scalarNode('mutation')->defaultNull()->end() |
|
52 | 36 | ->scalarNode('subscription')->defaultNull()->end() |
|
53 | 36 | ->end() |
|
54 | 36 | ->end() |
|
55 | 36 | ->arrayNode('mappings') |
|
56 | 36 | ->children() |
|
57 | 36 | ->arrayNode('types') |
|
58 | 36 | ->prototype('array') |
|
59 | 36 | ->addDefaultsIfNotSet() |
|
60 | 36 | ->children() |
|
61 | 36 | ->enumNode('type')->isRequired()->values(['yml', 'xml'])->end() |
|
62 | 36 | ->scalarNode('dir')->defaultNull()->end() |
|
63 | 36 | ->end() |
|
64 | 36 | ->end() |
|
65 | 36 | ->end() |
|
66 | 36 | ->end() |
|
67 | ->end() |
||
68 | 36 | // TODO remove when types mapping 100% functional |
|
69 | 36 | ->variableNode('types') |
|
70 | 36 | ->info('Defining types using semantic config is deprecated and will be soon removed.') |
|
71 | 36 | ->end() |
|
72 | 36 | ->end() |
|
73 | 36 | ->end() |
|
74 | 36 | ->arrayNode('templates') |
|
75 | 36 | ->addDefaultsIfNotSet() |
|
76 | 36 | ->children() |
|
77 | 36 | ->scalarNode('graphiql') |
|
78 | 36 | ->defaultValue('OverblogGraphQLBundle:GraphiQL:index.html.twig') |
|
79 | 36 | ->end() |
|
80 | 36 | ->end() |
|
81 | 36 | ->end() |
|
82 | 36 | ->arrayNode('services') |
|
83 | 36 | ->addDefaultsIfNotSet() |
|
84 | 36 | ->children() |
|
85 | 36 | ->scalarNode('expression_language') |
|
86 | 36 | ->defaultValue('overblog_graphql.expression_language.default') |
|
87 | 36 | ->end() |
|
88 | 36 | ->scalarNode('cache_expression_language_parser') |
|
89 | 36 | ->defaultValue('overblog_graphql.cache_expression_language_parser.default') |
|
90 | 36 | ->end() |
|
91 | 36 | ->end() |
|
92 | 36 | ->end() |
|
93 | 36 | ->arrayNode('security') |
|
94 | 36 | ->addDefaultsIfNotSet() |
|
95 | 36 | ->children() |
|
96 | 36 | ->append($this->addSecurityQuerySection('query_max_depth', QueryDepth::DISABLED)) |
|
97 | 36 | ->append($this->addSecurityQuerySection('query_max_complexity', QueryDepth::DISABLED)) |
|
98 | ->end() |
||
99 | ->end() |
||
100 | 36 | ->end() |
|
101 | 36 | ->end(); |
|
102 | 36 | ||
103 | return $treeBuilder; |
||
104 | 36 | } |
|
105 | 36 | ||
127 |