| Conditions | 2 |
| Paths | 2 |
| Total Lines | 59 |
| Code Lines | 41 |
| 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 |
||
| 69 | public function handle() |
||
| 70 | { |
||
| 71 | // Is the form being submitted to us? |
||
| 72 | if ($this->request->is_set_post('submit')) |
||
| 73 | { |
||
| 74 | $this->check_form_on_submit(); |
||
| 75 | |||
| 76 | // Set the options the user configured |
||
| 77 | |||
| 78 | $this->success_form_on_submit(); |
||
| 79 | } |
||
| 80 | |||
| 81 | $main_adm_path = $this->phpbb_root_path . $this->phpbb_adm_relative_path . 'index.' . $this->phpEx; |
||
| 82 | |||
| 83 | // Set output variables for display in the template |
||
| 84 | $this->template->assign_vars([ |
||
| 85 | 'MAS_PHPBB_LK_AV' => append_sid($main_adm_path, 'i=acp_board&mode=avatar#allow_avatar'), |
||
| 86 | 'MAS_PHPBB_LK_OL' => append_sid($main_adm_path, 'i=acp_board&mode=load#load_onlinetrack'), |
||
| 87 | 'MAS_PHPBB_AVATAR' => $this->config['allow_avatar'], |
||
| 88 | 'MAS_PHPBB_ONLINE' => $this->config['load_onlinetrack'], |
||
| 89 | // General |
||
| 90 | 'MAS_AVATAR' => $this->config['dark1_mas_avatar'], |
||
| 91 | 'MAS_ONLINE' => $this->config['dark1_mas_online'], |
||
| 92 | 'MAS_COLOR_OFFLINE' => $this->config['dark1_mas_col_off'], |
||
| 93 | 'MAS_COLOR_ONLINE' => $this->config['dark1_mas_col_on'], |
||
| 94 | // MemberList |
||
| 95 | 'MAS_ML_AVATAR' => $this->config['dark1_mas_ml_av'], |
||
| 96 | 'MAS_ML_AV_SIZE' => $this->config['dark1_mas_ml_av_sz'], |
||
| 97 | 'MAS_ML_ONLINE' => $this->config['dark1_mas_ml_ol'], |
||
| 98 | // ViewOnline |
||
| 99 | 'MAS_VO_PG_AVATAR' => $this->config['dark1_mas_vo_pg_av'], |
||
| 100 | 'MAS_VO_PG_AV_SIZE' => $this->config['dark1_mas_vo_pg_av_sz'], |
||
| 101 | 'MAS_VO_SB_AVATAR' => $this->config['dark1_mas_vo_sb_av'], |
||
| 102 | 'MAS_VO_SB_AV_SIZE' => $this->config['dark1_mas_vo_sb_av_sz'], |
||
| 103 | // ViewForum |
||
| 104 | 'MAS_VF_FP_AVATAR' => $this->config['dark1_mas_vf_fp_av'], |
||
| 105 | 'MAS_VF_FP_AV_SIZE' => $this->config['dark1_mas_vf_fp_av_sz'], |
||
| 106 | 'MAS_VF_FP_ONLINE' => $this->config['dark1_mas_vf_fp_ol'], |
||
| 107 | 'MAS_VF_LP_AVATAR' => $this->config['dark1_mas_vf_lp_av'], |
||
| 108 | 'MAS_VF_LP_AV_SIZE' => $this->config['dark1_mas_vf_lp_av_sz'], |
||
| 109 | 'MAS_VF_LP_ONLINE' => $this->config['dark1_mas_vf_lp_ol'], |
||
| 110 | // Search |
||
| 111 | 'MAS_SH_FP_AVATAR' => $this->config['dark1_mas_sh_fp_av'], |
||
| 112 | 'MAS_SH_FP_AV_SIZE' => $this->config['dark1_mas_sh_fp_av_sz'], |
||
| 113 | 'MAS_SH_FP_ONLINE' => $this->config['dark1_mas_sh_fp_ol'], |
||
| 114 | 'MAS_SH_LP_AVATAR' => $this->config['dark1_mas_sh_lp_av'], |
||
| 115 | 'MAS_SH_LP_AV_SIZE' => $this->config['dark1_mas_sh_lp_av_sz'], |
||
| 116 | 'MAS_SH_LP_ONLINE' => $this->config['dark1_mas_sh_lp_ol'], |
||
| 117 | 'MAS_SH_UP_AVATAR' => $this->config['dark1_mas_sh_up_av'], |
||
| 118 | 'MAS_SH_UP_AV_SIZE' => $this->config['dark1_mas_sh_up_av_sz'], |
||
| 119 | 'MAS_SH_UP_ONLINE' => $this->config['dark1_mas_sh_up_ol'], |
||
| 120 | // Review |
||
| 121 | 'MAS_RV_AVATAR' => $this->config['dark1_mas_rv_av'], |
||
| 122 | 'MAS_RV_AV_SIZE' => $this->config['dark1_mas_rv_av_sz'], |
||
| 123 | 'MAS_RV_ONLINE' => $this->config['dark1_mas_rv_ol'], |
||
| 124 | // Friendlist |
||
| 125 | 'MAS_FL_AVATAR' => $this->config['dark1_mas_fl_av'], |
||
| 126 | 'MAS_FL_AV_SIZE' => $this->config['dark1_mas_fl_av_sz'], |
||
| 127 | 'MAS_FL_ONLINE' => $this->config['dark1_mas_fl_ol'], |
||
| 128 | ]); |
||
| 131 |