Conditions | 1 |
Paths | 1 |
Total Lines | 80 |
Code Lines | 62 |
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 |
||
45 | public static function providerTextGrid(): array |
||
46 | { |
||
47 | return [ |
||
48 | 'cli default values' => [ |
||
49 | true, false, true, true, |
||
50 | [ |
||
51 | ' +-----+------------------+---+----------+', |
||
52 | ' | A | B | C | D |', |
||
53 | '+---+-----+------------------+---+----------+', |
||
54 | '| 1 | 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
55 | '| 2 | 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
56 | '| 3 | xyz | xyz | | |', |
||
57 | '+---+-----+------------------+---+----------+', |
||
58 | '', |
||
59 | ], |
||
60 | ], |
||
61 | 'html default values' => [ |
||
62 | false, false, true, true, |
||
63 | [ |
||
64 | '<pre>', |
||
65 | ' +-----+------------------+---+----------+', |
||
66 | ' | A | B | C | D |', |
||
67 | '+---+-----+------------------+---+----------+', |
||
68 | '| 1 | 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
69 | '| 2 | 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
70 | '| 3 | xyz | xyz | | |', |
||
71 | '+---+-----+------------------+---+----------+', |
||
72 | '</pre>', |
||
73 | ], |
||
74 | ], |
||
75 | 'cli rowDividers' => [ |
||
76 | true, true, true, true, |
||
77 | [ |
||
78 | ' +-----+------------------+---+----------+', |
||
79 | ' | A | B | C | D |', |
||
80 | '+---+-----+------------------+---+----------+', |
||
81 | '| 1 | 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
82 | '+---+-----+------------------+---+----------+', |
||
83 | '| 2 | 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
84 | '+---+-----+------------------+---+----------+', |
||
85 | '| 3 | xyz | xyz | | |', |
||
86 | '+---+-----+------------------+---+----------+', |
||
87 | '', |
||
88 | ], |
||
89 | ], |
||
90 | 'cli no columnHeaders' => [ |
||
91 | true, false, true, false, |
||
92 | [ |
||
93 | '+---+-----+------------------+--+----------+', |
||
94 | '| 1 | 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
95 | '| 2 | 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
96 | '| 3 | xyz | xyz | | |', |
||
97 | '+---+-----+------------------+--+----------+', |
||
98 | '', |
||
99 | ], |
||
100 | ], |
||
101 | 'cli no row headers' => [ |
||
102 | true, false, false, true, |
||
103 | [ |
||
104 | '+-----+------------------+---+----------+', |
||
105 | '| A | B | C | D |', |
||
106 | '+-----+------------------+---+----------+', |
||
107 | '| 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
108 | '| 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
109 | '| xyz | xyz | | |', |
||
110 | '+-----+------------------+---+----------+', |
||
111 | '', |
||
112 | ], |
||
113 | ], |
||
114 | 'cli row dividers, no row nor column headers' => [ |
||
115 | true, true, false, false, |
||
116 | [ |
||
117 | '+-----+------------------+--+----------+', |
||
118 | '| 6 | 1900-01-06 00:00 | | 0.572917 |', |
||
119 | '+-----+------------------+--+----------+', |
||
120 | '| 6 | 1900-01-06 00:00 | | 1<>2 |', |
||
121 | '+-----+------------------+--+----------+', |
||
122 | '| xyz | xyz | | |', |
||
123 | '+-----+------------------+--+----------+', |
||
124 | '', |
||
125 | ], |
||
160 |