Conditions | 1 |
Paths | 1 |
Total Lines | 76 |
Code Lines | 61 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
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 |
||
20 | protected static function vcStyleConfig(): array |
||
21 | { |
||
22 | return [ |
||
23 | // 'style_preset' => [ |
||
24 | // 'group' => 'design', |
||
25 | // 'heading' => esc_html_x('Style', 'admin-text', 'site-reviews'), |
||
26 | // 'options' => [ |
||
27 | // '1' => esc_html_x('Style 1', 'admin-text', 'site-reviews'), |
||
28 | // '2' => esc_html_x('Style 2', 'admin-text', 'site-reviews'), |
||
29 | // '3' => esc_html_x('Style 3', 'admin-text', 'site-reviews'), |
||
30 | // ], |
||
31 | // 'placeholder' => esc_html_x('Default', 'admin-text', 'site-reviews'), |
||
32 | // 'prefix_class' => 'is-style-', |
||
33 | // 'std' => '', |
||
34 | // 'type' => 'dropdown', |
||
35 | // ], |
||
36 | // 'style_align' => [ |
||
37 | // 'group' => 'design', |
||
38 | // 'heading' => esc_html_x('Alignment', 'admin-text', 'site-reviews'), |
||
39 | // 'options' => [ |
||
40 | // 'left' => esc_html_x('Start', 'admin-text', 'site-reviews'), |
||
41 | // 'center' => esc_html_x('Center', 'admin-text', 'site-reviews'), |
||
42 | // 'right' => esc_html_x('End', 'admin-text', 'site-reviews'), |
||
43 | // ], |
||
44 | // 'std' => 'left', |
||
45 | // 'type' => 'dropdown', |
||
46 | // ], |
||
47 | // 'style_max_width' => [ |
||
48 | // 'group' => 'design', |
||
49 | // 'heading' => esc_html_x('Max Width', 'admin-text', 'site-reviews'), |
||
50 | // 'type' => 'textfield', |
||
51 | // ], |
||
52 | // 'style_rating_color' => [ |
||
53 | // 'group' => 'design', |
||
54 | // 'heading' => esc_html_x('Star Color', 'admin-text', 'site-reviews'), |
||
55 | // 'type' => 'colorpicker', |
||
56 | // ], |
||
57 | // 'style_rating_size' => [ |
||
58 | // 'group' => 'design', |
||
59 | // 'heading' => esc_html_x('Star Size', 'admin-text', 'site-reviews'), |
||
60 | // 'type' => 'textfield', |
||
61 | // ], |
||
62 | // 'style_bar_color' => [ |
||
63 | // 'group' => 'design', |
||
64 | // 'heading' => esc_html_x('Bar Color', 'admin-text', 'site-reviews'), |
||
65 | // 'type' => 'colorpicker', |
||
66 | // ], |
||
67 | // 'style_bar_gap' => [ |
||
68 | // 'group' => 'design', |
||
69 | // 'heading' => esc_html_x('Bar Gap', 'admin-text', 'site-reviews'), |
||
70 | // 'type' => 'textfield', |
||
71 | // ], |
||
72 | // 'style_bar_size' => [ |
||
73 | // 'group' => 'design', |
||
74 | // 'heading' => esc_html_x('Bar Size', 'admin-text', 'site-reviews'), |
||
75 | // 'type' => 'textfield', |
||
76 | // ], |
||
77 | ]; |
||
78 | } |
||
79 | } |
||
80 |