| Conditions | 1 |
| Paths | 1 |
| Total Lines | 54 |
| Code Lines | 52 |
| 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 |
||
| 79 | public function addConfiguration(ArrayNodeDefinition $builder): void |
||
| 80 | { |
||
| 81 | $builder |
||
| 82 | ->children() |
||
| 83 | ->scalarNode('bucket') |
||
| 84 | ->isRequired() |
||
| 85 | ->cannotBeEmpty() |
||
| 86 | ->end() |
||
| 87 | ->arrayNode('client_config') |
||
| 88 | ->isRequired() |
||
| 89 | ->children() |
||
| 90 | ->arrayNode('credentials') |
||
| 91 | ->variablePrototype() |
||
| 92 | ->isRequired() |
||
| 93 | ->end() |
||
| 94 | ->end() |
||
| 95 | ->scalarNode('version') |
||
| 96 | ->defaultValue('2016-03-01') |
||
| 97 | ->end() |
||
| 98 | ->scalarNode('region')->end() |
||
| 99 | ->arrayNode('extras') |
||
| 100 | ->arrayPrototype()->end() |
||
| 101 | ->end() |
||
| 102 | ->end() |
||
| 103 | ->end() |
||
| 104 | ->scalarNode('cache') |
||
| 105 | ->defaultValue(false) |
||
| 106 | ->end() |
||
| 107 | ->scalarNode('acl') |
||
| 108 | ->defaultValue('public-read') |
||
| 109 | ->cannotBeEmpty() |
||
| 110 | ->end() |
||
| 111 | ->scalarNode('cache_prefix') |
||
| 112 | ->defaultValue(null) |
||
| 113 | ->end() |
||
| 114 | ->arrayNode('get_options') |
||
| 115 | ->useAttributeAsKey('key') |
||
| 116 | ->prototype('scalar')->end() |
||
| 117 | ->end() |
||
| 118 | ->arrayNode('put_options') |
||
| 119 | ->useAttributeAsKey('key') |
||
| 120 | ->prototype('scalar')->end() |
||
| 121 | ->end() |
||
| 122 | ->arrayNode('del_options') |
||
| 123 | ->useAttributeAsKey('key') |
||
| 124 | ->prototype('scalar')->end() |
||
| 125 | ->end() |
||
| 126 | ->arrayNode('proxies') |
||
| 127 | ->defaultValue([]) |
||
| 128 | ->useAttributeAsKey('name') |
||
| 129 | ->prototype('scalar')->end() |
||
| 130 | ->end() |
||
| 131 | ->end(); |
||
| 132 | } |
||
| 133 | |||
| 168 |