Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
Code Lines | 27 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
14 | public function objectCastDataProvider() |
||
15 | { |
||
16 | return [ |
||
17 | [ |
||
18 | CompiledExpression::INTEGER, |
||
19 | 1 |
||
20 | ], |
||
21 | [ |
||
22 | CompiledExpression::DOUBLE, |
||
23 | 1.0 |
||
24 | ], |
||
25 | [ |
||
26 | CompiledExpression::ARR, |
||
27 | [ |
||
28 | 1, |
||
29 | 2, |
||
30 | 3, |
||
31 | 4, |
||
32 | 5 |
||
33 | ] |
||
34 | ], |
||
35 | [ |
||
36 | CompiledExpression::ARR, |
||
37 | [] |
||
38 | ], |
||
39 | [ |
||
40 | CompiledExpression::ARR, |
||
41 | [ |
||
42 | 1, |
||
43 | 2, |
||
44 | 3, |
||
45 | 4, |
||
46 | 5 |
||
47 | ] |
||
48 | ], |
||
49 | [ |
||
50 | CompiledExpression::BOOLEAN, |
||
51 | true |
||
52 | ], |
||
53 | [ |
||
54 | CompiledExpression::RESOURCE, |
||
55 | STDIN |
||
56 | ], |
||
57 | [ |
||
58 | CompiledExpression::STRING, |
||
59 | 'test str' |
||
60 | ], |
||
61 | [ |
||
62 | CompiledExpression::NULL, |
||
63 | null |
||
64 | ], |
||
65 | ]; |
||
66 | } |
||
67 | |||
98 |