| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| Code Lines | 54 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
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 declare(strict_types=1); |
||
| 34 | public function configure(ArrayNodeDefinition $builder) |
||
| 35 | { |
||
| 36 | $builder |
||
| 37 | ->children() |
||
| 38 | ->scalarNode('base_url') |
||
| 39 | ->isRequired() |
||
| 40 | ->cannotBeEmpty() |
||
| 41 | ->end() |
||
| 42 | |||
| 43 | ->arrayNode('debug') |
||
|
1 ignored issue
–
show
|
|||
| 44 | ->canBeDisabled() |
||
| 45 | ->children() |
||
| 46 | ->scalarNode('formatter') |
||
| 47 | ->defaultValue('pretty') |
||
| 48 | ->info('Not used anymore, only here for BC') |
||
| 49 | ->end() |
||
| 50 | |||
| 51 | ->arrayNode('introspection') |
||
| 52 | ->info('Debug Introspection configuration') |
||
| 53 | ->addDefaultsIfNotSet() |
||
| 54 | ->children() |
||
| 55 | ->arrayNode('var_dumper') |
||
| 56 | ->addDefaultsIfNotSet() |
||
| 57 | ->children() |
||
| 58 | ->arrayNode('json') |
||
| 59 | ->addDefaultsIfNotSet() |
||
| 60 | ->children() |
||
| 61 | ->arrayNode('types') |
||
| 62 | ->info('Types to be used in the json var-dumper adapter') |
||
| 63 | ->defaultValue(['application/json']) |
||
| 64 | ->prototype('scalar')->end() |
||
| 65 | ->end() |
||
| 66 | ->end() |
||
| 67 | ->end() |
||
| 68 | ->end() |
||
| 69 | ->end() |
||
| 70 | ->end() |
||
| 71 | ->end() |
||
| 72 | |||
| 73 | ->arrayNode('headers') |
||
| 74 | ->info('Headers to print in Debug Http introspection adapters') |
||
| 75 | ->addDefaultsIfNotSet() |
||
| 76 | ->children() |
||
| 77 | ->arrayNode('request') |
||
| 78 | ->info('Request headers to print in Debug Http introspection adapters') |
||
| 79 | ->defaultValue(['Content-Type']) |
||
| 80 | ->prototype('scalar')->end() |
||
| 81 | ->end() |
||
| 82 | |||
| 83 | ->arrayNode('response') |
||
| 84 | ->info('Response headers to print in Debug Http introspection adapters') |
||
| 85 | ->defaultValue(['Content-Type']) |
||
| 86 | ->prototype('scalar')->end() |
||
| 87 | ->end() |
||
| 88 | ->end() |
||
| 89 | ->end() |
||
| 90 | ->end() |
||
| 91 | ->end() |
||
| 92 | ->end() |
||
| 93 | ->end(); |
||
| 94 | |||
| 200 |