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