| Conditions | 1 |
| Paths | 1 |
| Total Lines | 107 |
| Code Lines | 76 |
| 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 |
||
| 83 | public function buildForm(FormBuilderInterface $builder): void |
||
| 84 | { |
||
| 85 | $builder |
||
| 86 | ->add('default_document_quotum') |
||
| 87 | ->add('default_group_quotum') |
||
| 88 | ->add('permanently_remove_deleted_files', YesNoType::class) |
||
| 89 | ->add( |
||
| 90 | 'upload_extensions_list_type', |
||
| 91 | ChoiceType::class, |
||
| 92 | [ |
||
| 93 | 'choices' => [ |
||
| 94 | 'Black list' => 'blacklist', |
||
| 95 | 'White list' => 'whitelist', |
||
| 96 | ], |
||
| 97 | ] |
||
| 98 | ) |
||
| 99 | ->add('upload_extensions_blacklist', TextareaType::class) |
||
| 100 | ->add('upload_extensions_whitelist', TextareaType::class) |
||
| 101 | ->add('upload_extensions_skip', TextareaType::class) |
||
| 102 | ->add('upload_extensions_replace_by', TextareaType::class) |
||
| 103 | ->add('permissions_for_new_directories') |
||
| 104 | ->add('permissions_for_new_files') |
||
| 105 | ->add( |
||
| 106 | 'show_glossary_in_documents', |
||
| 107 | ChoiceType::class, |
||
| 108 | [ |
||
| 109 | 'choices' => [ |
||
| 110 | 'Show glossary in documents is none' => 'none', |
||
| 111 | 'Show glossary in documents is manual' => 'ismanual', |
||
| 112 | 'Show glossary in documents is automatic' => 'isautomatic', |
||
| 113 | ], |
||
| 114 | ] |
||
| 115 | ) |
||
| 116 | ->add('students_download_folders', YesNoType::class) |
||
| 117 | ->add('users_copy_files', YesNoType::class) |
||
| 118 | ->add('pdf_export_watermark_enable', YesNoType::class) |
||
| 119 | ->add('pdf_export_watermark_by_course', YesNoType::class) |
||
| 120 | ->add('pdf_export_watermark_text', TextareaType::class) |
||
| 121 | ->add('students_export2pdf', YesNoType::class) |
||
| 122 | ->add('show_users_folders', YesNoType::class) |
||
| 123 | ->add('show_default_folders', YesNoType::class) |
||
| 124 | ->add('enabled_text2audio', YesNoType::class) |
||
| 125 | // ->add('enable_nanogong', YesNoType::class) |
||
| 126 | ->add('show_documents_preview', YesNoType::class) |
||
| 127 | ->add('enable_webcam_clip', YesNoType::class) |
||
| 128 | ->add( |
||
| 129 | 'tool_visible_by_default_at_creation', |
||
| 130 | ChoiceType::class, |
||
| 131 | [ |
||
| 132 | 'multiple' => true, |
||
| 133 | 'choices' => [ |
||
| 134 | 'Documents' => 'documents', |
||
| 135 | 'LearningPath' => 'learning_path', |
||
| 136 | 'Links' => 'links', |
||
| 137 | 'Announcements' => 'announcements', |
||
| 138 | 'Forums' => 'forums', |
||
| 139 | 'Quiz' => 'quiz', |
||
| 140 | 'Gradebook' => 'gradebook', |
||
| 141 | ], |
||
| 142 | ] |
||
| 143 | ) |
||
| 144 | ->add('send_notification_when_document_added', YesNoType::class) |
||
| 145 | ->add( |
||
| 146 | 'thematic_pdf_orientation', |
||
| 147 | ChoiceType::class, |
||
| 148 | [ |
||
| 149 | 'choices' => [ |
||
| 150 | 'Portrait' => 'portrait', |
||
| 151 | 'Landscape' => 'landscape', |
||
| 152 | ], |
||
| 153 | ] |
||
| 154 | ) |
||
| 155 | ->add( |
||
| 156 | 'certificate_pdf_orientation', |
||
| 157 | ChoiceType::class, |
||
| 158 | [ |
||
| 159 | 'choices' => [ |
||
| 160 | 'Portrait' => 'portrait', |
||
| 161 | 'Landscape' => 'landscape', |
||
| 162 | ], |
||
| 163 | ] |
||
| 164 | ) |
||
| 165 | ->add('allow_general_certificate', YesNoType::class) |
||
| 166 | ->add('group_document_access', YesNoType::class) |
||
| 167 | ->add('group_category_document_access', YesNoType::class) |
||
| 168 | ->add('allow_compilatio_tool', YesNoType::class) |
||
| 169 | ->add( |
||
| 170 | 'compilatio_tool', |
||
| 171 | TextareaType::class, |
||
| 172 | [ |
||
| 173 | 'help_html' => true, |
||
| 174 | 'help' => $this->settingArrayHelpValue('compilatio_tool'), |
||
| 175 | ] |
||
| 176 | ) |
||
| 177 | ->add('documents_hide_download_icon', YesNoType::class) |
||
| 178 | ->add('enable_x_sendfile_headers', YesNoType::class) |
||
| 179 | ->add( |
||
| 180 | 'documents_custom_cloud_link_list', |
||
| 181 | TextareaType::class, |
||
| 182 | [ |
||
| 183 | 'help_html' => true, |
||
| 184 | 'help' => $this->settingArrayHelpValue('documents_custom_cloud_link_list'), |
||
| 185 | ] |
||
| 186 | ) |
||
| 187 | ; |
||
| 188 | |||
| 189 | $this->updateFormFieldsFromSettingsInfo($builder); |
||
| 190 | } |
||
| 223 |