| Conditions | 1 |
| Paths | 1 |
| Total Lines | 55 |
| 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 |
||
| 53 | private function addResourcesSection(ArrayNodeDefinition $node) |
||
| 54 | { |
||
| 55 | $node |
||
| 56 | ->children() |
||
| 57 | ->arrayNode('resources') |
||
| 58 | ->addDefaultsIfNotSet() |
||
| 59 | ->children() |
||
| 60 | ->arrayNode('product_image') |
||
| 61 | ->addDefaultsIfNotSet() |
||
| 62 | ->children() |
||
| 63 | ->variableNode('options')->end() |
||
| 64 | ->arrayNode('classes') |
||
| 65 | ->addDefaultsIfNotSet() |
||
| 66 | ->children() |
||
| 67 | ->scalarNode('model')->defaultValue(ProductImage::class)->cannotBeEmpty()->end() |
||
| 68 | ->scalarNode('interface')->defaultValue(ProductImageInterface::class)->cannotBeEmpty()->end() |
||
| 69 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||
| 70 | ->end() |
||
| 71 | ->end() |
||
| 72 | ->end() |
||
| 73 | ->end() |
||
| 74 | ->arrayNode('taxon_image') |
||
| 75 | ->addDefaultsIfNotSet() |
||
| 76 | ->children() |
||
| 77 | ->variableNode('options')->end() |
||
| 78 | ->arrayNode('classes') |
||
| 79 | ->addDefaultsIfNotSet() |
||
| 80 | ->children() |
||
| 81 | ->scalarNode('model')->defaultValue(TaxonImage::class)->cannotBeEmpty()->end() |
||
| 82 | ->scalarNode('interface')->defaultValue(TaxonImageInterface::class)->cannotBeEmpty()->end() |
||
| 83 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||
| 84 | ->end() |
||
| 85 | ->end() |
||
| 86 | ->end() |
||
| 87 | ->end() |
||
| 88 | ->arrayNode('product_taxon') |
||
| 89 | ->addDefaultsIfNotSet() |
||
| 90 | ->children() |
||
| 91 | ->variableNode('options')->end() |
||
| 92 | ->arrayNode('classes') |
||
| 93 | ->addDefaultsIfNotSet() |
||
| 94 | ->children() |
||
| 95 | ->scalarNode('model')->defaultValue(ProductTaxon::class)->cannotBeEmpty()->end() |
||
| 96 | ->scalarNode('interface')->defaultValue(ProductTaxonInterface::class)->cannotBeEmpty()->end() |
||
| 97 | ->scalarNode('controller')->defaultValue(ProductTaxonController::class)->cannotBeEmpty()->end() |
||
| 98 | ->scalarNode('factory')->defaultValue(Factory::class)->end() |
||
| 99 | ->end() |
||
| 100 | ->end() |
||
| 101 | ->end() |
||
| 102 | ->end() |
||
| 103 | ->end() |
||
| 104 | ->end() |
||
| 105 | ->end() |
||
| 106 | ; |
||
| 107 | } |
||
| 108 | |||
| 125 |