Conditions | 5 |
Paths | 1 |
Total Lines | 122 |
Code Lines | 103 |
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 |
||
179 | protected function appearanceSettings() |
||
180 | { |
||
181 | return new EE_Form_Section_Proper( |
||
182 | array( |
||
183 | 'name' => 'recaptcha_appearance_settings_tbl', |
||
184 | 'html_id' => 'recaptcha_appearance_settings_tbl', |
||
185 | 'html_class' => 'form-table', |
||
186 | 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
||
187 | 'subsections' => apply_filters( |
||
188 | 'FHEE__EED_Recaptcha___recaptcha_appearance_settings__form_subsections', |
||
189 | array( |
||
190 | 'recaptcha_theme' => new EE_Radio_Button_Input( |
||
191 | array( |
||
192 | 'invisible' => esc_html__('Invisible', 'event_espresso'), |
||
193 | 'light' => esc_html__('Light', 'event_espresso'), |
||
194 | 'dark' => esc_html__('Dark', 'event_espresso'), |
||
195 | ), |
||
196 | array( |
||
197 | 'html_label_text' => esc_html__('Theme', 'event_espresso'), |
||
198 | 'html_help_text' => esc_html__('The color theme of the widget.', |
||
199 | 'event_espresso'), |
||
200 | 'default' => $this->config->recaptcha_theme !== null |
||
201 | ? $this->config->recaptcha_theme |
||
202 | : 'invisible', |
||
203 | 'display_html_label_text' => false, |
||
204 | ) |
||
205 | ), |
||
206 | 'recaptcha_badge' => new EE_Radio_Button_Input( |
||
207 | array( |
||
208 | 'bottomleft' => esc_html__('Bottom Left', 'event_espresso'), |
||
209 | 'bottomright' => esc_html__('Bottom Right', 'event_espresso'), |
||
210 | 'inline' => esc_html__('Inline', 'event_espresso'), |
||
211 | ), |
||
212 | array( |
||
213 | 'html_label_text' => esc_html__('Invisible reCAPTCHA Badge Position', 'event_espresso'), |
||
214 | 'html_help_text' => esc_html__( |
||
215 | 'If using Invisible reCAPTCHA, then this determines the position of the reCAPTCHA badge. "Bottom Left" and "Bottom Right" both will float at the bottom of the screen. "Inline" appears beside the submit button but allows you to control the CSS.', |
||
216 | 'event_espresso' |
||
217 | ), |
||
218 | 'default' => $this->config->recaptcha_badge !== null |
||
219 | ? $this->config->recaptcha_badge |
||
220 | : 'bottomleft', |
||
221 | 'display_html_label_text' => false, |
||
222 | ) |
||
223 | ), |
||
224 | 'recaptcha_type' => new EE_Radio_Button_Input( |
||
225 | array( |
||
226 | 'image' => esc_html__('Image', 'event_espresso'), |
||
227 | 'audio' => esc_html__('Audio', 'event_espresso'), |
||
228 | ), |
||
229 | array( |
||
230 | 'html_label_text' => esc_html__('Type', 'event_espresso'), |
||
231 | 'html_help_text' => esc_html__('The type of CAPTCHA to serve.', |
||
232 | 'event_espresso'), |
||
233 | 'default' => $this->config->recaptcha_type !== null |
||
234 | ? $this->config->recaptcha_type |
||
235 | : 'image', |
||
236 | 'display_html_label_text' => false, |
||
237 | ) |
||
238 | ), |
||
239 | 'recaptcha_language' => new EE_Select_Input( |
||
240 | array( |
||
241 | 'ar' => esc_html__('Arabic', 'event_espresso'), |
||
242 | 'bg' => esc_html__('Bulgarian', 'event_espresso'), |
||
243 | 'ca' => esc_html__('Catalan', 'event_espresso'), |
||
244 | 'zh-CN' => esc_html__('Chinese (Simplified)', 'event_espresso'), |
||
245 | 'zh-TW' => esc_html__('Chinese (Traditional) ', 'event_espresso'), |
||
246 | 'hr' => esc_html__('Croatian', 'event_espresso'), |
||
247 | 'cs' => esc_html__('Czech', 'event_espresso'), |
||
248 | 'da' => esc_html__('Danish', 'event_espresso'), |
||
249 | 'nl' => esc_html__('Dutch', 'event_espresso'), |
||
250 | 'en-GB' => esc_html__('English (UK)', 'event_espresso'), |
||
251 | 'en' => esc_html__('English (US)', 'event_espresso'), |
||
252 | 'fil' => esc_html__('Filipino', 'event_espresso'), |
||
253 | 'fi' => esc_html__('Finnish', 'event_espresso'), |
||
254 | 'fr' => esc_html__('French', 'event_espresso'), |
||
255 | 'fr-CA' => esc_html__('French (Canadian)', 'event_espresso'), |
||
256 | 'de' => esc_html__('German', 'event_espresso'), |
||
257 | 'de-AT' => esc_html__('German (Austria)', 'event_espresso'), |
||
258 | 'de-CH' => esc_html__('German (Switzerland)', 'event_espresso'), |
||
259 | 'el' => esc_html__('Greek', 'event_espresso'), |
||
260 | 'iw' => esc_html__('Hebrew', 'event_espresso'), |
||
261 | 'hi' => esc_html__('Hindi', 'event_espresso'), |
||
262 | 'hu' => esc_html__('Hungarian', 'event_espresso'), |
||
263 | 'id' => esc_html__('Indonesian', 'event_espresso'), |
||
264 | 'it' => esc_html__('Italian', 'event_espresso'), |
||
265 | 'ja' => esc_html__('Japanese', 'event_espresso'), |
||
266 | 'ko' => esc_html__('Korean', 'event_espresso'), |
||
267 | 'lv' => esc_html__('Latvian', 'event_espresso'), |
||
268 | 'lt' => esc_html__('Lithuanian', 'event_espresso'), |
||
269 | 'no' => esc_html__('Norwegian', 'event_espresso'), |
||
270 | 'fa' => esc_html__('Persian', 'event_espresso'), |
||
271 | 'pl' => esc_html__('Polish', 'event_espresso'), |
||
272 | 'pt' => esc_html__('Portuguese', 'event_espresso'), |
||
273 | 'pt-BR' => esc_html__('Portuguese (Brazil)', 'event_espresso'), |
||
274 | 'pt-PT' => esc_html__('Portuguese (Portugal)', 'event_espresso'), |
||
275 | 'ro' => esc_html__('Romanian', 'event_espresso'), |
||
276 | 'ru' => esc_html__('Russian', 'event_espresso'), |
||
277 | 'sr' => esc_html__('Serbian', 'event_espresso'), |
||
278 | 'sk' => esc_html__('Slovak', 'event_espresso'), |
||
279 | 'sl' => esc_html__('Slovenian', 'event_espresso'), |
||
280 | 'es' => esc_html__('Spanish', 'event_espresso'), |
||
281 | 'es-419' => esc_html__('Spanish (Latin America)', 'event_espresso'), |
||
282 | 'sv' => esc_html__('Swedish', 'event_espresso'), |
||
283 | 'th' => esc_html__('Thai', 'event_espresso'), |
||
284 | 'tr' => esc_html__('Turkish', 'event_espresso'), |
||
285 | 'uk' => esc_html__('Ukrainian', 'event_espresso'), |
||
286 | 'vi' => esc_html__('Vietnamese', 'event_espresso'), |
||
287 | ), |
||
288 | array( |
||
289 | 'html_label_text' => esc_html__('Language', 'event_espresso'), |
||
290 | 'html_help_text' => esc_html__('Forces the widget to render in a specific language.', |
||
291 | 'event_espresso'), |
||
292 | 'default' => $this->config->recaptcha_language !== null |
||
293 | ? $this->config->recaptcha_language : 'en', |
||
294 | ) |
||
295 | ), |
||
296 | ) |
||
297 | ), |
||
298 | ) |
||
299 | ); |
||
300 | } |
||
301 | |||
372 |