| Conditions | 1 |
| Paths | 1 |
| Total Lines | 65 |
| Code Lines | 60 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 18 | public function getConfigTreeBuilder() |
||
| 19 | { |
||
| 20 | $treeBuilder = new TreeBuilder(); |
||
| 21 | $rootNode = $treeBuilder->root('knp_rad'); |
||
| 22 | |||
| 23 | $rootNode |
||
| 24 | ->children() |
||
| 25 | ->arrayNode('detect') |
||
| 26 | ->addDefaultsIfNotSet() |
||
| 27 | ->children() |
||
| 28 | ->booleanNode('entity')->defaultTrue()->end() |
||
| 29 | ->booleanNode('form_creator')->defaultTrue()->end() |
||
| 30 | ->booleanNode('form_extension')->defaultTrue()->end() |
||
| 31 | ->booleanNode('form_type')->defaultTrue()->end() |
||
| 32 | ->booleanNode('twig')->defaultTrue()->end() |
||
| 33 | ->booleanNode('security_voter')->defaultTrue()->end() |
||
| 34 | ->booleanNode('validator_constraint')->defaultTrue()->end() |
||
| 35 | ->end() |
||
| 36 | ->end() |
||
| 37 | ->arrayNode('mailer') |
||
| 38 | ->addDefaultsIfNotSet() |
||
| 39 | ->children() |
||
| 40 | ->booleanNode('logger')->defaultFalse()->end() |
||
| 41 | ->booleanNode('message_factory')->defaultTrue()->end() |
||
| 42 | ->end() |
||
| 43 | ->end() |
||
| 44 | ->booleanNode('domain_event')->defaultTrue()->end() |
||
| 45 | ->arrayNode('listener') |
||
| 46 | ->addDefaultsIfNotSet() |
||
| 47 | ->children() |
||
| 48 | ->booleanNode('view')->defaultTrue()->end() |
||
| 49 | ->booleanNode('resource_resolver')->defaultTrue()->end() |
||
| 50 | ->booleanNode('orm_user')->defaultTrue()->end() |
||
| 51 | ->booleanNode('exception_rethrow')->defaultFalse()->end() |
||
| 52 | ->end() |
||
| 53 | ->end() |
||
| 54 | ->booleanNode('routing_loader')->defaultTrue()->end() |
||
| 55 | ->booleanNode('form_manager')->defaultTrue()->end() |
||
| 56 | ->booleanNode('security_voter')->defaultTrue()->end() |
||
| 57 | ->booleanNode('datatable')->defaultTrue()->end() |
||
| 58 | ->booleanNode('alice')->defaultTrue()->end() |
||
| 59 | ->arrayNode('flashes') |
||
| 60 | ->addDefaultsIfNotSet() |
||
| 61 | ->canBeDisabled() |
||
| 62 | ->children() |
||
| 63 | ->scalarNode('trans_catalog')->defaultValue('messages')->end() |
||
| 64 | ->end() |
||
| 65 | ->end() |
||
| 66 | ->arrayNode('csrf_links') |
||
| 67 | ->addDefaultsIfNotSet() |
||
| 68 | ->canBeEnabled() |
||
| 69 | ->children() |
||
| 70 | ->scalarNode('intention')->defaultValue('link')->end() |
||
| 71 | ->end() |
||
| 72 | ->end() |
||
| 73 | ->arrayNode('security') |
||
| 74 | ->addDefaultsIfNotSet() |
||
| 75 | ->children() |
||
| 76 | ->scalarNode('decision_manager')->defaultValue('security.access.decision_manager')->end() |
||
| 77 | ->end() |
||
| 78 | ->end() |
||
| 79 | ; |
||
| 80 | |||
| 81 | return $treeBuilder; |
||
| 82 | } |
||
| 83 | } |
||
| 84 |