Conditions | 1 |
Paths | 1 |
Total Lines | 108 |
Code Lines | 81 |
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 |
||
135 | function getColors() |
||
136 | { |
||
137 | return [ |
||
138 | 'default' => [ |
||
139 | 'label' => __('Default', 'flynt'), |
||
140 | 'colors' => [ |
||
141 | 'accent' => [ |
||
142 | 'label' => __('Accent', 'flynt'), |
||
143 | 'default' => '#2b44df', |
||
144 | 'hsl' => 1, |
||
145 | ], |
||
146 | 'headline' => [ |
||
147 | 'label' => __('Headline', 'flynt'), |
||
148 | 'default' => '#252525', |
||
149 | ], |
||
150 | 'text' => [ |
||
151 | 'label' => __('Text', 'flynt'), |
||
152 | 'default' => '#353535', |
||
153 | ], |
||
154 | 'border' => [ |
||
155 | 'label' => __('Border', 'flynt'), |
||
156 | 'default' => '#8791BA', |
||
157 | 'hsl' => 1, |
||
158 | ], |
||
159 | 'background' => [ |
||
160 | 'label' => __('Background', 'flynt'), |
||
161 | 'default' => '#ffffff', |
||
162 | ], |
||
163 | ], |
||
164 | ], |
||
165 | 'light' => [ |
||
166 | 'label' => __('Theme Light', 'flynt'), |
||
167 | 'colors' => [ |
||
168 | 'accent' => [ |
||
169 | 'label' => __('Accent', 'flynt'), |
||
170 | 'default' => '#2b44df', |
||
171 | 'hsl' => 1, |
||
172 | ], |
||
173 | 'headline' => [ |
||
174 | 'label' => __('Headline', 'flynt'), |
||
175 | 'default' => '#252525', |
||
176 | ], |
||
177 | 'text' => [ |
||
178 | 'label' => __('Text', 'flynt'), |
||
179 | 'default' => '#353535', |
||
180 | ], |
||
181 | 'border' => [ |
||
182 | 'label' => __('Border', 'flynt'), |
||
183 | 'default' => '#8791BA', |
||
184 | 'hsl' => 1, |
||
185 | ], |
||
186 | 'background' => [ |
||
187 | 'label' => __('Background', 'flynt'), |
||
188 | 'default' => '#F8F9FD', |
||
189 | ], |
||
190 | ], |
||
191 | ], |
||
192 | 'dark' => [ |
||
193 | 'label' => __('Theme Dark', 'flynt'), |
||
194 | 'colors' => [ |
||
195 | 'accent' => [ |
||
196 | 'label' => __('Accent', 'flynt'), |
||
197 | 'default' => '#ffffff', |
||
198 | 'hsl' => 1, |
||
199 | ], |
||
200 | 'headline' => [ |
||
201 | 'label' => __('Headline', 'flynt'), |
||
202 | 'default' => '#FBFBFB', |
||
203 | ], |
||
204 | 'text' => [ |
||
205 | 'label' => __('Text', 'flynt'), |
||
206 | 'default' => '#E9E9EC', |
||
207 | ], |
||
208 | 'border' => [ |
||
209 | 'label' => __('Border', 'flynt'), |
||
210 | 'default' => '#C3C4F7', |
||
211 | 'hsl' => 1, |
||
212 | ], |
||
213 | 'background' => [ |
||
214 | 'label' => __('Background', 'flynt'), |
||
215 | 'default' => '#10205A', |
||
216 | ], |
||
217 | ], |
||
218 | ], |
||
219 | 'hero' => [ |
||
220 | 'label' => __('Theme Hero', 'flynt'), |
||
221 | 'colors' => [ |
||
222 | 'accent' => [ |
||
223 | 'label' => __('Accent', 'flynt'), |
||
224 | 'default' => '#ffffff', |
||
225 | 'hsl' => 1, |
||
226 | ], |
||
227 | 'headline' => [ |
||
228 | 'label' => __('Headline', 'flynt'), |
||
229 | 'default' => '#FBFBFB', |
||
230 | ], |
||
231 | 'text' => [ |
||
232 | 'label' => __('Text', 'flynt'), |
||
233 | 'default' => '#E9E9EC', |
||
234 | ], |
||
235 | 'border' => [ |
||
236 | 'label' => __('Border', 'flynt'), |
||
237 | 'default' => '#CDE2FD', |
||
238 | 'hsl' => 1, |
||
239 | ], |
||
240 | 'background' => [ |
||
241 | 'label' => __('Background', 'flynt'), |
||
242 | 'default' => '#2B44DF', |
||
243 | ], |
||
248 |