Conditions | 1 |
Paths | 1 |
Total Lines | 60 |
Code Lines | 20 |
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 |
||
17 | public function getSetEmptyLineDataProvider() { |
||
18 | return [ |
||
19 | [ |
||
20 | '<?php |
||
21 | |||
22 | |||
23 | echo 1;', |
||
24 | '<?php |
||
25 | |||
26 | echo 1;', |
||
27 | |||
28 | ], |
||
29 | [ |
||
30 | '<?php echo 1;', |
||
31 | '<?php |
||
32 | |||
33 | echo 1;', |
||
34 | ], |
||
35 | [ |
||
36 | '<?php |
||
37 | echo 1;', |
||
38 | '<?php |
||
39 | |||
40 | echo 1;', |
||
41 | ], |
||
42 | [ |
||
43 | '<? echo 1;', |
||
44 | '<? |
||
45 | |||
46 | echo 1;', |
||
47 | 'process' => (boolean) ini_get('short_open_tag'), |
||
48 | ], |
||
49 | [ |
||
50 | '<? |
||
51 | echo 1;', |
||
52 | '<? |
||
53 | |||
54 | echo 1;', |
||
55 | 'process' => (boolean) ini_get('short_open_tag'), |
||
56 | ], |
||
57 | [ |
||
58 | '<? |
||
59 | echo 1;', |
||
60 | '<? |
||
61 | |||
62 | echo 1;', |
||
63 | 'process' => (boolean) ini_get('short_open_tag'), |
||
64 | ], |
||
65 | [ |
||
66 | '<? |
||
67 | |||
68 | |||
69 | echo 1;', |
||
70 | '<? |
||
71 | |||
72 | echo 1;', |
||
73 | 'process' => (boolean) ini_get('short_open_tag'), |
||
74 | ], |
||
75 | ]; |
||
76 | } |
||
77 | |||
95 |