Conditions | 1 |
Paths | 1 |
Total Lines | 89 |
Code Lines | 58 |
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 |
||
218 | public function provideBlocks() |
||
219 | { |
||
220 | yield [ |
||
221 | IO::VERBOSITY_NORMAL, |
||
222 | false, |
||
223 | 25, |
||
224 | 'OK', |
||
225 | 'This is a block', |
||
226 | IO::VERBOSITY_NORMAL, |
||
227 | <<<'EOF' |
||
228 | |||
229 | |||
230 | [OK] This is a block |
||
231 | |||
232 | |||
233 | EOF |
||
234 | ]; |
||
235 | |||
236 | yield [ |
||
237 | IO::VERBOSITY_NORMAL, |
||
238 | true, |
||
239 | 25, |
||
240 | 'OK', |
||
241 | 'This is a block', |
||
242 | IO::VERBOSITY_NORMAL, |
||
243 | <<<'EOF' |
||
244 | [0m |
||
245 | [0m[30;42m [0m |
||
246 | [0m[30;42m [OK] This is a block [0m |
||
247 | [0m[30;42m [0m[0m |
||
248 | [0m |
||
249 | EOF |
||
250 | ]; |
||
251 | |||
252 | yield [ |
||
253 | IO::VERBOSITY_VERBOSE, |
||
254 | false, |
||
255 | 25, |
||
256 | 'OK', |
||
257 | 'This is a block', |
||
258 | IO::VERBOSITY_NORMAL, |
||
259 | <<<'EOF' |
||
260 | |||
261 | |||
262 | [OK] This is a block |
||
263 | |||
264 | |||
265 | EOF |
||
266 | ]; |
||
267 | |||
268 | yield [ |
||
269 | IO::VERBOSITY_NORMAL, |
||
270 | false, |
||
271 | 25, |
||
272 | 'OK', |
||
273 | 'This is a block', |
||
274 | IO::VERBOSITY_VERBOSE, |
||
275 | '', |
||
276 | ]; |
||
277 | |||
278 | yield [ |
||
279 | IO::VERBOSITY_NORMAL, |
||
280 | false, |
||
281 | 20, |
||
282 | 'OK', |
||
283 | 'This is a very long block that should be displayed on 5 lines', |
||
284 | IO::VERBOSITY_NORMAL, |
||
285 | <<<'EOF' |
||
286 | |||
287 | |||
288 | [OK] This is a |
||
289 | very long |
||
290 | block that |
||
291 | should be |
||
292 | displayed |
||
293 | on 5 lines |
||
294 | |||
295 | |||
296 | EOF |
||
297 | ]; |
||
298 | |||
299 | yield [ |
||
300 | IO::VERBOSITY_NORMAL, |
||
301 | true, |
||
302 | 20, |
||
303 | 'OK', |
||
304 | 'This is a very long block that should be displayed on 5 lines', |
||
305 | IO::VERBOSITY_NORMAL, |
||
306 | <<<'EOF' |
||
307 | [0m |
||
321 |