Conditions | 1 |
Paths | 1 |
Total Lines | 81 |
Code Lines | 65 |
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 |
||
117 | public function getParameterProvider() |
||
118 | { |
||
119 | return array( |
||
120 | array( |
||
121 | '', |
||
122 | array( |
||
123 | '', |
||
124 | '', |
||
125 | '', |
||
126 | '', |
||
127 | '', |
||
128 | ), |
||
129 | ), |
||
130 | array( |
||
131 | '`foo` TEXT', |
||
132 | array( |
||
133 | '', |
||
134 | 'foo', |
||
135 | 'TEXT', |
||
136 | '', |
||
137 | '', |
||
138 | ), |
||
139 | ), |
||
140 | array( |
||
141 | '`foo` INT(20)', |
||
142 | array( |
||
143 | '', |
||
144 | 'foo', |
||
145 | 'INT', |
||
146 | '20', |
||
147 | '', |
||
148 | ), |
||
149 | ), |
||
150 | array( |
||
151 | 'IN `fo``fo` INT UNSIGNED', |
||
152 | array( |
||
153 | 'IN', |
||
154 | 'fo`fo', |
||
155 | 'INT', |
||
156 | '', |
||
157 | 'UNSIGNED', |
||
158 | ), |
||
159 | ), |
||
160 | array( |
||
161 | 'OUT bar VARCHAR(1) CHARSET utf8', |
||
162 | array( |
||
163 | 'OUT', |
||
164 | 'bar', |
||
165 | 'VARCHAR', |
||
166 | '1', |
||
167 | 'utf8', |
||
168 | ), |
||
169 | ), |
||
170 | array( |
||
171 | '`"baz\'\'` ENUM(\'a\', \'b\') CHARSET latin1', |
||
172 | array( |
||
173 | '', |
||
174 | '"baz\'\'', |
||
175 | 'ENUM', |
||
176 | '\'a\',\'b\'', |
||
177 | 'latin1', |
||
178 | ), |
||
179 | ), |
||
180 | array( |
||
181 | 'INOUT `foo` DECIMAL(5,2) UNSIGNED ZEROFILL', |
||
182 | array( |
||
183 | 'INOUT', |
||
184 | 'foo', |
||
185 | 'DECIMAL', |
||
186 | '5,2', |
||
187 | 'UNSIGNED ZEROFILL', |
||
188 | ), |
||
189 | ), |
||
190 | array( |
||
191 | '`foo``s func` SET(\'test\'\'esc"\', \'more\\\'esc\')', |
||
192 | array( |
||
193 | '', |
||
194 | 'foo`s func', |
||
195 | 'SET', |
||
196 | '\'test\'\'esc"\',\'more\\\'esc\'', |
||
197 | '', |
||
198 | ), |
||
311 |