| Conditions | 1 |
| Paths | 1 |
| Total Lines | 79 |
| 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 |
||
| 86 | public function buildForm(FormBuilderInterface $builder) |
||
| 87 | { |
||
| 88 | $tabs = [ |
||
| 89 | 'TabsCampusHomepage' => 'campus_homepage', |
||
| 90 | 'TabsMyCourses' => 'my_courses', |
||
| 91 | 'TabsReporting' => 'reporting', |
||
| 92 | 'TabsPlatformAdministration' => 'platform_administration', |
||
| 93 | 'mypersonalopenarea' => 'my_agenda', |
||
| 94 | 'TabsMyAgenda' => 'my_profile', |
||
| 95 | 'TabsMyGradebook' => 'my_gradebook', |
||
| 96 | 'TabsSocial' => 'social', |
||
| 97 | 'TabsDashboard' => 'dashboard' |
||
| 98 | ]; |
||
| 99 | |||
| 100 | $builder |
||
| 101 | ->add('institution') |
||
| 102 | ->add('institution_url', 'url') |
||
| 103 | ->add('institution_address') |
||
| 104 | ->add('site_name') |
||
| 105 | // ->add('administrator_email', 'email') |
||
| 106 | // ->add('administrator_name') |
||
| 107 | // ->add('administrator_surname') |
||
| 108 | // ->add('administrator_phone') |
||
| 109 | ->add('timezone', 'timezone') |
||
| 110 | ->add('theme') |
||
| 111 | ->add('gravatar_enabled', YesNoType::class) |
||
| 112 | ->add( |
||
| 113 | 'gravatar_type', |
||
| 114 | 'choice', |
||
| 115 | [ |
||
| 116 | 'choices' => [ |
||
| 117 | 'mm' => 'mistery-man', |
||
| 118 | 'identicon' => 'identicon', |
||
| 119 | 'monsterid' => 'monsterid', |
||
| 120 | 'wavatar' => 'wavatar', |
||
| 121 | ], |
||
| 122 | ] |
||
| 123 | ) |
||
| 124 | ->add('gamification_mode') |
||
| 125 | ->add('order_user_list_by_official_code', YesNoType::class) |
||
| 126 | ->add('cookie_warning', YesNoType::class) |
||
| 127 | ->add('donotlistcampus', YesNoType::class) |
||
| 128 | ->add('course_catalog_hide_private', YesNoType::class) |
||
| 129 | ->add( |
||
| 130 | 'catalog_show_courses_sessions', |
||
| 131 | 'choice', |
||
| 132 | ['choices' => [ |
||
| 133 | '0' => 'CatalogueShowOnlyCourses', |
||
| 134 | '1' => 'CatalogueShowOnlySessions', |
||
| 135 | '2' => 'CatalogueShowCoursesAndSessions', |
||
| 136 | ]] |
||
| 137 | ) |
||
| 138 | ->add('use_custom_pages', YesNoType::class) |
||
| 139 | ->add('pdf_logo_header') |
||
| 140 | ->add('allow_my_files', YesNoType::class) |
||
| 141 | // old settings with no category |
||
| 142 | ->add('chamilo_database_version') |
||
| 143 | ->add('registered', YesNoType::class) |
||
| 144 | ->add( |
||
| 145 | 'load_term_conditions_section', |
||
| 146 | 'choice', |
||
| 147 | [ |
||
| 148 | 'choices' => [ |
||
| 149 | '0' => 'Login', |
||
| 150 | '1' => 'Course', |
||
| 151 | ], |
||
| 152 | ] |
||
| 153 | ) |
||
| 154 | ->add('server_type', YesNoType::class) |
||
| 155 | ->add('show_full_skill_name_on_skill_wheel', YesNoType::class) |
||
| 156 | ->add('show_official_code_whoisonline', YesNoType::class) |
||
| 157 | ->add( |
||
| 158 | 'show_tabs', |
||
| 159 | 'choice', |
||
| 160 | [ |
||
| 161 | 'multiple' => true, |
||
| 162 | 'choices' => $tabs, |
||
| 163 | 'label' => 'ShowTabsTitle', |
||
| 164 | 'help_block' => 'ShowTabsComment' |
||
| 165 | ] |
||
| 170 |