Conditions | 1 |
Paths | 1 |
Total Lines | 52 |
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 |
||
23 | public function optionsProvider() { |
||
24 | return [ |
||
25 | [ |
||
26 | [ |
||
27 | HookRunner::OPT_DO_PARSE => true, |
||
28 | ], |
||
29 | [], |
||
30 | [], |
||
31 | [], |
||
32 | ], |
||
33 | [ |
||
34 | [ |
||
35 | HookRunner::OPT_DO_PARSE => false, |
||
36 | ], |
||
37 | [], |
||
38 | [], |
||
39 | [], |
||
40 | ], |
||
41 | [ |
||
42 | [ |
||
43 | HookRunner::OPT_DO_PARSE => true, |
||
44 | ], |
||
45 | [ |
||
46 | 'foo' => 'bar', |
||
47 | 'baz' => 'bah', |
||
48 | ], |
||
49 | [], |
||
50 | [ |
||
51 | 'foo' => 'bar', |
||
52 | 'baz' => 'bah', |
||
53 | ], |
||
54 | ], |
||
55 | [ |
||
56 | [ |
||
57 | HookRunner::OPT_DO_PARSE => true, |
||
58 | ], |
||
59 | [ |
||
60 | 'foo' => 'bar', |
||
61 | 'baz' => 'bah', |
||
62 | ], |
||
63 | [ |
||
64 | 'ohi', |
||
65 | 'there', |
||
66 | ], |
||
67 | [ |
||
68 | 'ohi' => self::INPUT_TEXT, |
||
69 | 'foo' => 'bar', |
||
70 | 'baz' => 'bah', |
||
71 | ], |
||
72 | ], |
||
73 | ]; |
||
74 | } |
||
75 | |||
180 |