Conditions | 1 |
Paths | 1 |
Total Lines | 54 |
Code Lines | 31 |
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 |
||
40 | public function providerDStDevP(): array |
||
41 | { |
||
42 | return [ |
||
43 | [ |
||
44 | 2.653299832284, |
||
45 | $this->database1(), |
||
46 | 'Yield', |
||
47 | [ |
||
48 | ['Tree'], |
||
49 | ['=Apple'], |
||
50 | ['=Pear'], |
||
51 | ], |
||
52 | ], |
||
53 | [ |
||
54 | 0.085244745684, |
||
55 | $this->database3FilledIn(), |
||
56 | 'Score', |
||
57 | [ |
||
58 | ['Subject', 'Gender'], |
||
59 | ['English', 'Male'], |
||
60 | ], |
||
61 | ], |
||
62 | [ |
||
63 | 0.160623784042, |
||
64 | $this->database3FilledIn(), |
||
65 | 'Score', |
||
66 | [ |
||
67 | ['Subject', 'Age'], |
||
68 | ['Math', '>8'], |
||
69 | ], |
||
70 | ], |
||
71 | [ |
||
72 | 0.01, |
||
73 | $this->database3(), |
||
74 | 'Score', |
||
75 | [ |
||
76 | ['Subject', 'Gender'], |
||
77 | ['English', 'Male'], |
||
78 | ], |
||
79 | ], |
||
80 | [ |
||
81 | 0, |
||
82 | $this->database3(), |
||
83 | 'Score', |
||
84 | [ |
||
85 | ['Subject', 'Age'], |
||
86 | ['Math', '>8'], |
||
87 | ], |
||
88 | ], |
||
89 | 'omitted field name' => [ |
||
90 | ExcelError::VALUE(), |
||
91 | $this->database1(), |
||
92 | null, |
||
93 | $this->database1(), |
||
94 | ], |
||
98 |