Conditions | 1 |
Paths | 1 |
Total Lines | 58 |
Code Lines | 44 |
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 |
||
89 | public function buildForm(FormBuilderInterface $builder): void |
||
90 | { |
||
91 | $builder |
||
92 | ->add('institution') |
||
93 | ->add('institution_url', UrlType::class) |
||
94 | ->add('institution_address') |
||
95 | ->add('site_name') |
||
96 | ->add('timezone', TimezoneType::class) |
||
97 | ->add('cookie_warning', YesNoType::class) |
||
98 | ->add('donotlistcampus', YesNoType::class) |
||
99 | ->add('use_custom_pages', YesNoType::class) |
||
100 | ->add('allow_my_files', YesNoType::class) |
||
101 | ->add( |
||
102 | 'server_type', |
||
103 | ChoiceType::class, |
||
104 | [ |
||
105 | 'label' => 'Server Type', |
||
106 | 'choices' => [ |
||
107 | 'Production' => 'prod', |
||
108 | 'Validation' => 'validation', |
||
109 | 'Test/Development' => 'test', |
||
110 | ], |
||
111 | ] |
||
112 | ) |
||
113 | ->add( |
||
114 | 'show_tabs', |
||
115 | ChoiceType::class, |
||
116 | [ |
||
117 | 'multiple' => true, |
||
118 | 'choices' => self::$tabs, |
||
119 | ], |
||
120 | ) |
||
121 | ->add('unoconv_binaries', TextType::class) |
||
122 | ->add('pdf_img_dpi', TextType::class) |
||
123 | ->add('hosting_limit_users_per_course', TextType::class) |
||
124 | ->add('generate_random_login', YesNoType::class) |
||
125 | ->add('timepicker_increment', TextType::class) |
||
126 | ->add('user_status_show_options_enabled', YesNoType::class) |
||
127 | ->add('user_status_show_option', TextareaType::class) |
||
128 | ->add('platform_logo_url', TextType::class) |
||
129 | ->add('use_career_external_id_as_identifier_in_diagrams', YesNoType::class) |
||
130 | ->add('portfolio_advanced_sharing', TextType::class) |
||
131 | ->add('notification_event', YesNoType::class) |
||
132 | ->add('push_notification_settings', TextareaType::class) |
||
133 | ->add( |
||
134 | 'hosting_limit_identical_email', |
||
135 | TextType::class, |
||
136 | [ |
||
137 | 'label' => 'Limit identical emails', |
||
138 | 'help' => 'Maximum number of accounts allowed with the same email. Set to 0 to disable limit.', |
||
139 | ] |
||
140 | ) |
||
141 | ->add('session_admin_access_to_all_users_on_all_urls', YesNoType::class) |
||
142 | ->add('use_virtual_keyboard', YesNoType::class) |
||
143 | ->add('disable_copy_paste', YesNoType::class) |
||
144 | ; |
||
145 | |||
146 | $this->updateFormFieldsFromSettingsInfo($builder); |
||
147 | } |
||
157 |