Conditions | 1 |
Paths | 1 |
Total Lines | 79 |
Code Lines | 76 |
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 |
||
36 | public function configure(ArrayNodeDefinition $builder) |
||
37 | { |
||
38 | $builder |
||
39 | ->children() |
||
40 | ->arrayNode('symfony_kernel') |
||
41 | ->addDefaultsIfNotSet() |
||
42 | ->children() |
||
43 | ->scalarNode('bootstrap') |
||
44 | ->defaultValue('app/autoload.php') |
||
45 | ->end() |
||
46 | ->scalarNode('path') |
||
47 | ->defaultValue('app/AppKernel.php') |
||
48 | ->end() |
||
49 | ->scalarNode('class') |
||
50 | ->defaultValue('AppKernel') |
||
51 | ->end() |
||
52 | ->scalarNode('env') |
||
53 | ->defaultValue('test') |
||
54 | ->end() |
||
55 | ->booleanNode('debug') |
||
56 | ->defaultTrue() |
||
57 | ->end() |
||
58 | ->end() |
||
59 | ->end() |
||
60 | ->arrayNode('alice') |
||
61 | ->addDefaultsIfNotSet() |
||
62 | ->children() |
||
63 | ->scalarNode('locale') |
||
64 | ->defaultValue('en_US') |
||
65 | ->end() |
||
66 | ->arrayNode('fixtures') |
||
67 | ->prototype('scalar')->end() |
||
68 | ->end() |
||
69 | ->arrayNode('dependencies') |
||
70 | ->useAttributeAsKey('name') |
||
71 | ->prototype('array') |
||
72 | ->prototype('scalar')->end() |
||
73 | ->end() |
||
74 | ->end() |
||
75 | ->arrayNode('providers') |
||
76 | ->prototype('scalar')->end() |
||
77 | ->end() |
||
78 | ->end() |
||
79 | ->end() |
||
80 | ->arrayNode('entities') |
||
81 | ->addDefaultsIfNotSet() |
||
82 | ->children() |
||
83 | ->arrayNode('namespaces') |
||
84 | ->prototype('scalar')->end() |
||
85 | ->end() |
||
86 | ->end() |
||
87 | ->end() |
||
88 | ->arrayNode('page') |
||
89 | ->addDefaultsIfNotSet() |
||
90 | ->children() |
||
91 | ->scalarNode('namespace') |
||
92 | ->defaultValue('Page') |
||
93 | ->end() |
||
94 | ->end() |
||
95 | ->end() |
||
96 | ->arrayNode('api') |
||
97 | ->addDefaultsIfNotSet() |
||
98 | ->children() |
||
99 | ->scalarNode('base_url') |
||
100 | ->defaultValue('') |
||
101 | ->end() |
||
102 | ->end() |
||
103 | ->end() |
||
104 | ->arrayNode('smartStep') |
||
105 | ->addDefaultsIfNotSet() |
||
106 | ->children() |
||
107 | ->booleanNode('enabled')->defaultFalse()->end() |
||
108 | ->scalarNode('tagName')->defaultValue('smartStep')->end() |
||
109 | ->end() |
||
110 | ->end() |
||
111 | ->scalarNode('smartTag')->end() |
||
112 | ->end() |
||
113 | ; |
||
114 | } |
||
115 | |||
147 |