Conditions | 1 |
Paths | 1 |
Total Lines | 75 |
Code Lines | 56 |
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 |
||
85 | public function buildForm(FormBuilderInterface $builder): void |
||
86 | { |
||
87 | $builder |
||
88 | ->add('enable_help_link', YesNoType::class) |
||
89 | ->add('show_administrator_data', YesNoType::class) |
||
90 | ->add('show_tutor_data', YesNoType::class) |
||
91 | ->add('show_teacher_data', YesNoType::class) |
||
92 | ->add( |
||
93 | 'showonline', |
||
94 | ChoiceType::class, |
||
95 | [ |
||
96 | 'choices' => [ |
||
97 | 'Course' => 'course', |
||
98 | 'Users' => 'users', |
||
99 | 'World' => 'world', |
||
100 | ], |
||
101 | ] |
||
102 | ) |
||
103 | ->add('time_limit_whosonline') |
||
104 | ->add('show_email_addresses', YesNoType::class) |
||
105 | ->add('show_number_of_courses', YesNoType::class) |
||
106 | ->add('show_empty_course_categories', YesNoType::class) |
||
107 | ->add('show_back_link_on_top_of_tree', YesNoType::class) |
||
108 | ->add('show_empty_course_categories', YesNoType::class) |
||
109 | ->add('display_categories_on_homepage', YesNoType::class) |
||
110 | ->add('show_closed_courses', YesNoType::class) |
||
111 | ->add('accessibility_font_resize', YesNoType::class) |
||
112 | ->add( |
||
113 | 'show_admin_toolbar', |
||
114 | ChoiceType::class, |
||
115 | [ |
||
116 | 'choices' => [ |
||
117 | 'Do not show' => 'do_not_show', |
||
118 | 'Show to admins only' => 'show_to_admin', |
||
119 | 'Show to admins and teachers' => 'show_to_admin_and_teachers', |
||
120 | 'Show to all users' => 'show_to_all', |
||
121 | ], |
||
122 | ] |
||
123 | ) |
||
124 | ->add('show_hot_courses', YesNoType::class) |
||
125 | ->add('hide_home_top_when_connected', YesNoType::class) |
||
126 | ->add('hide_logout_button', YesNoType::class) |
||
127 | ->add('icons_mode_svg', YesNoType::class) |
||
128 | ->add('hide_social_media_links', YesNoType::class) |
||
129 | ->add('gravatar_enabled', YesNoType::class) |
||
130 | ->add( |
||
131 | 'gravatar_type', |
||
132 | ChoiceType::class, |
||
133 | [ |
||
134 | 'choices' => [ |
||
135 | 'mistery-man' => 'mm', |
||
136 | 'identicon' => 'identicon', |
||
137 | 'monsterid' => 'monsterid', |
||
138 | 'wavatar' => 'wavatar', |
||
139 | ], |
||
140 | ] |
||
141 | ) |
||
142 | ->add('order_user_list_by_official_code', YesNoType::class) |
||
143 | ->add('pdf_logo_header') |
||
144 | ->add( |
||
145 | 'show_tabs', |
||
146 | ChoiceType::class, |
||
147 | [ |
||
148 | 'multiple' => true, |
||
149 | 'choices' => self::$tabs, |
||
150 | ], |
||
151 | ) |
||
152 | ->add('show_tabs_per_role', TextareaType::class) |
||
153 | ->add('hide_main_navigation_menu', YesNoType::class) |
||
154 | ->add('hide_complete_name_in_whoisonline', YesNoType::class) |
||
155 | ->add('table_default_row', TextType::class) |
||
156 | ->add('table_row_list', TextareaType::class) |
||
157 | ; |
||
158 | |||
159 | $this->updateFormFieldsFromSettingsInfo($builder); |
||
160 | } |
||
162 |