Conditions | 1 |
Paths | 1 |
Total Lines | 82 |
Code Lines | 59 |
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 |
||
32 | public function getMarkupSet(): array |
||
33 | { |
||
34 | return [ |
||
35 | [ |
||
36 | 'name' => "<i class='fa fa-bold'></i>", |
||
37 | 'title' => __('Bold'), |
||
38 | 'className' => 'btn-markup-Bold', |
||
39 | 'type' => 'enclose', |
||
40 | 'openWith' => '[b]', |
||
41 | 'closeWith' => '[/b]', |
||
42 | ], |
||
43 | [ |
||
44 | 'name' => "<i class='fa fa-italic'></i>", |
||
45 | 'title' => __('Italic'), |
||
46 | 'className' => 'btn-markup-Italic', |
||
47 | 'type' => 'enclose', |
||
48 | 'openWith' => '[i]', |
||
49 | 'closeWith' => '[/i]', |
||
50 | ], |
||
51 | [ |
||
52 | 'name' => "<i class='fa fa-strikethrough'></i>", |
||
53 | 'title' => __('Strike Through'), |
||
54 | 'className' => 'btn-markup-Stroke', |
||
55 | 'type' => 'enclose', |
||
56 | 'openWith' => '[strike]', |
||
57 | 'closeWith' => '[/strike]', |
||
58 | ], |
||
59 | [ |
||
60 | 'name' => "<i class='fa fa-s-code'></i>", |
||
61 | 'title' => __('Code'), |
||
62 | 'className' => 'btn-markup-Code', |
||
63 | 'type' => 'enclose', |
||
64 | 'openWith' => "[code=text]\n", |
||
65 | 'closeWith' => "\n[/code]", |
||
66 | ], |
||
67 | [ |
||
68 | 'name' => "<i class='fa fa-list-ul'></i>", |
||
69 | 'title' => __('Bullet List'), |
||
70 | 'className' => 'btn-markup-List', |
||
71 | 'type' => 'enclose', |
||
72 | 'openWith' => "[list]\n[*] ", |
||
73 | 'closeWith' => "\n[*]\n[/list]", |
||
74 | ], |
||
75 | [ |
||
76 | 'name' => "<i class='fa fa-stop'></i>", |
||
77 | 'className' => 'btn-markup-Spoiler', |
||
78 | 'title' => __('Spoiler'), |
||
79 | 'type' => 'enclose', |
||
80 | 'openWith' => '[spoiler]', |
||
81 | 'closeWith' => '[/spoiler]', |
||
82 | ], |
||
83 | [ |
||
84 | 'name' => "<i class='fa fa-quote-left'></i>", |
||
85 | 'className' => 'btn-markup-Quote', |
||
86 | 'title' => __('Cite'), |
||
87 | 'type' => 'enclose', |
||
88 | 'openWith' => '[quote]', |
||
89 | 'closeWith' => '[/quote]', |
||
90 | ], |
||
91 | [ |
||
92 | 'type' => 'separator', |
||
93 | ], |
||
94 | [ |
||
95 | 'name' => "<i class='fa fa-link'></i>", |
||
96 | 'title' => __('Link'), |
||
97 | 'className' => 'btn-markup-Link', |
||
98 | 'type' => 'saito-link', |
||
99 | 'handler' => 'link', |
||
100 | ], |
||
101 | [ |
||
102 | 'name' => "<i class='fa fa-multimedia'></i>", |
||
103 | 'className' => 'btn-markup-Media', |
||
104 | 'title' => __('Media'), |
||
105 | 'type' => 'saito-media', |
||
106 | 'handler' => 'media', |
||
107 | ], |
||
108 | [ |
||
109 | 'name' => '<i class=\'fa fa-upload\'></i>', |
||
110 | 'title' => __('Upload'), |
||
111 | 'className' => 'btn-markup-Upload', |
||
112 | 'type' => 'saito-upload', |
||
113 | 'handler' => 'upload', |
||
114 | ], |
||
118 |