| Conditions | 1 |
| Paths | 1 |
| Total Lines | 71 |
| Code Lines | 54 |
| 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 |
||
| 77 | public function buildForm(FormBuilderInterface $builder): void |
||
| 78 | { |
||
| 79 | $builder |
||
| 80 | ->add('default_document_quotum') |
||
| 81 | ->add('default_group_quotum') |
||
| 82 | ->add('permanently_remove_deleted_files', YesNoType::class) |
||
| 83 | ->add('upload_extensions_list_type', ChoiceType::class, [ |
||
| 84 | 'choices' => [ |
||
| 85 | 'Black list' => 'blacklist', |
||
| 86 | 'White list' => 'whitelist', |
||
| 87 | ], |
||
| 88 | ]) |
||
| 89 | ->add('upload_extensions_blacklist', TextareaType::class, [ |
||
| 90 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 91 | ]) |
||
| 92 | ->add('upload_extensions_whitelist', TextareaType::class, [ |
||
| 93 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 94 | ]) |
||
| 95 | ->add('upload_extensions_skip', TextareaType::class, [ |
||
| 96 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 97 | ]) |
||
| 98 | ->add('upload_extensions_replace_by', TextareaType::class, [ |
||
| 99 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 100 | ]) |
||
| 101 | ->add('permissions_for_new_directories') |
||
| 102 | ->add('permissions_for_new_files') |
||
| 103 | ->add('students_download_folders', YesNoType::class) |
||
| 104 | ->add('users_copy_files', YesNoType::class) |
||
| 105 | ->add('pdf_export_watermark_enable', YesNoType::class) |
||
| 106 | ->add('pdf_export_watermark_by_course', YesNoType::class) |
||
| 107 | ->add('pdf_export_watermark_text', TextareaType::class, [ |
||
| 108 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 109 | ]) |
||
| 110 | ->add('students_export2pdf', YesNoType::class) |
||
| 111 | ->add('show_users_folders', YesNoType::class) |
||
| 112 | ->add('show_default_folders', YesNoType::class) |
||
| 113 | ->add('show_documents_preview', YesNoType::class) |
||
| 114 | ->add('tool_visible_by_default_at_creation', ChoiceType::class, [ |
||
| 115 | 'multiple' => true, |
||
| 116 | 'choices' => [ |
||
| 117 | 'Documents' => 'documents', |
||
| 118 | 'LearningPath' => 'learning_path', |
||
| 119 | 'Links' => 'links', |
||
| 120 | 'Announcements' => 'announcements', |
||
| 121 | 'Forums' => 'forums', |
||
| 122 | 'Quiz' => 'quiz', |
||
| 123 | 'Gradebook' => 'gradebook', |
||
| 124 | ], |
||
| 125 | ]) |
||
| 126 | ->add('send_notification_when_document_added', YesNoType::class) |
||
| 127 | ->add('thematic_pdf_orientation', ChoiceType::class, [ |
||
| 128 | 'choices' => [ |
||
| 129 | 'Portrait' => 'portrait', |
||
| 130 | 'Landscape' => 'landscape', |
||
| 131 | ], |
||
| 132 | ]) |
||
| 133 | ->add('group_document_access', YesNoType::class) |
||
| 134 | ->add('group_category_document_access', YesNoType::class) |
||
| 135 | ->add('documents_hide_download_icon', YesNoType::class) |
||
| 136 | ->add('enable_x_sendfile_headers', YesNoType::class) |
||
| 137 | ->add('documents_custom_cloud_link_list', TextareaType::class, [ |
||
| 138 | 'attr' => ['rows' => 3, 'style' => 'font-family: monospace;'], |
||
| 139 | ]) |
||
| 140 | ->add('access_url_specific_files', YesNoType::class) |
||
| 141 | ->add('video_features', TextareaType::class, [ |
||
| 142 | 'attr' => ['rows' => 4, 'style' => 'font-family: monospace;'], |
||
| 143 | 'help' => 'JSON opcional. Ej: {"speed": true}', |
||
| 144 | ]) |
||
| 145 | ; |
||
| 146 | |||
| 147 | $this->updateFormFieldsFromSettingsInfo($builder); |
||
| 148 | } |
||
| 150 |