Conditions | 1 |
Paths | 1 |
Total Lines | 62 |
Code Lines | 53 |
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 |
||
65 | public function buildForm(FormBuilderInterface $builder): void |
||
66 | { |
||
67 | $builder |
||
68 | ->add('changeable_options', ChoiceType::class, [ |
||
69 | 'multiple' => true, |
||
70 | 'choices' => [ |
||
71 | 'Name' => 'name', |
||
72 | 'Official code' => 'officialcode', |
||
73 | 'E-mail' => 'email', |
||
74 | 'Picture' => 'picture', |
||
75 | 'Login' => 'login', |
||
76 | 'Password' => 'password', |
||
77 | 'Language' => 'language', |
||
78 | 'Phone' => 'phone', |
||
79 | 'Theme' => 'theme', |
||
80 | ], |
||
81 | ]) |
||
82 | ->add('visible_options', ChoiceType::class, [ |
||
83 | 'multiple' => true, |
||
84 | 'choices' => [ |
||
85 | 'Name' => 'name', |
||
86 | 'Official code' => 'officialcode', |
||
87 | 'E-mail' => 'email', |
||
88 | 'Picture' => 'picture', |
||
89 | 'Login' => 'login', |
||
90 | 'Password' => 'password', |
||
91 | 'Language' => 'language', |
||
92 | 'Phone' => 'phone', |
||
93 | 'Theme' => 'theme', |
||
94 | ], |
||
95 | ]) |
||
96 | ->add('extended_profile', YesNoType::class) |
||
97 | ->add('account_valid_duration') |
||
98 | ->add('split_users_upload_directory', YesNoType::class) |
||
99 | ->add('user_selected_theme', YesNoType::class) |
||
100 | ->add('use_users_timezone', YesNoType::class) |
||
101 | ->add('allow_users_to_change_email_with_no_password', YesNoType::class) |
||
102 | ->add('login_is_email', YesNoType::class, [ |
||
103 | 'label' => 'LoginIsEmailTitle', |
||
104 | ]) |
||
105 | ->add('enable_profile_user_address_geolocalization', YesNoType::class) |
||
106 | ->add('allow_show_skype_account', YesNoType::class) |
||
107 | ->add('allow_show_linkedin_url', YesNoType::class) |
||
108 | ->add('hide_username_with_complete_name', YesNoType::class) |
||
109 | ->add('hide_username_in_course_chat', YesNoType::class) |
||
110 | ->add('show_official_code_whoisonline', YesNoType::class) |
||
111 | ->add('my_space_users_items_per_page', TextType::class) |
||
112 | ->add('add_user_course_information_in_mailto', YesNoType::class) |
||
113 | ->add('pass_reminder_custom_link', TextType::class) |
||
114 | ->add('registration_add_helptext_for_2_names', YesNoType::class) |
||
115 | ->add('send_notification_when_user_added', TextareaType::class) |
||
116 | ->add('show_conditions_to_user', TextareaType::class) |
||
117 | ->add('allow_teachers_to_classes', YesNoType::class) |
||
118 | ->add('profile_fields_visibility', TextareaType::class) |
||
119 | ->add('user_import_settings', TextareaType::class) |
||
120 | ->add('user_search_on_extra_fields', TextareaType::class) |
||
121 | ->add('allow_social_map_fields', TextareaType::class) |
||
122 | ->add('linkedin_organization_id', YesNoType::class) |
||
123 | ->add('show_terms_if_profile_completed', YesNoType::class) |
||
124 | ; |
||
125 | |||
126 | $this->updateFormFieldsFromSettingsInfo($builder); |
||
127 | } |
||
129 |