| Conditions | 1 |
| Paths | 1 |
| Total Lines | 63 |
| Code Lines | 52 |
| 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 |
||
| 18 | public function buildSettings(AbstractSettingsBuilder $builder): void |
||
| 19 | { |
||
| 20 | $builder |
||
| 21 | ->setDefaults( |
||
| 22 | [ |
||
| 23 | 'default_document_quotum' => '1000', |
||
| 24 | 'default_group_quotum' => '250', |
||
| 25 | 'permanently_remove_deleted_files' => 'false', |
||
| 26 | 'upload_extensions_list_type' => 'blacklist', |
||
| 27 | 'upload_extensions_blacklist' => '', |
||
| 28 | 'upload_extensions_whitelist' => 'htm;html;jpg;jpeg;gif;png;swf;avi;mpg;mpeg;mov;flv;doc;docx;xls;xlsx;ppt;pptx;odt;odp;ods;pdf;webm;oga;ogg;ogv;h264', |
||
| 29 | 'upload_extensions_skip' => 'true', |
||
| 30 | 'upload_extensions_replace_by' => 'dangerous', |
||
| 31 | 'permissions_for_new_directories' => '0777', |
||
| 32 | 'permissions_for_new_files' => '0666', |
||
| 33 | 'show_glossary_in_documents' => 'none', |
||
| 34 | 'students_download_folders' => 'true', |
||
| 35 | 'users_copy_files' => 'true', |
||
| 36 | 'pdf_export_watermark_enable' => 'false', |
||
| 37 | 'pdf_export_watermark_by_course' => 'false', |
||
| 38 | 'pdf_export_watermark_text' => '', |
||
| 39 | 'students_export2pdf' => 'true', |
||
| 40 | 'show_users_folders' => 'true', |
||
| 41 | 'show_default_folders' => 'true', |
||
| 42 | 'enabled_text2audio' => 'false', |
||
| 43 | // 'enable_nanogong' => 'false', |
||
| 44 | 'show_documents_preview' => 'false', |
||
| 45 | 'enable_webcam_clip' => 'false', |
||
| 46 | 'tool_visible_by_default_at_creation' => [ |
||
| 47 | 'documents', |
||
| 48 | 'learning_path', |
||
| 49 | 'links', |
||
| 50 | 'announcements', |
||
| 51 | 'forums', |
||
| 52 | 'quiz', |
||
| 53 | 'gradebook', |
||
| 54 | ], |
||
| 55 | 'documents_default_visibility_defined_in_course' => 'false', |
||
| 56 | 'send_notification_when_document_added' => 'false', |
||
| 57 | 'thematic_pdf_orientation' => 'landscape', |
||
| 58 | 'certificate_pdf_orientation' => 'landscape', |
||
| 59 | 'allow_general_certificate' => 'false', |
||
| 60 | 'group_document_access' => 'false', |
||
| 61 | 'group_category_document_access' => 'false', |
||
| 62 | 'allow_compilatio_tool' => 'false', |
||
| 63 | 'compilatio_tool' => '', |
||
| 64 | 'documents_hide_download_icon' => 'false', |
||
| 65 | 'enable_x_sendfile_headers' => 'false', |
||
| 66 | 'documents_custom_cloud_link_list' => '', |
||
| 67 | ] |
||
| 68 | ) |
||
| 69 | ->setTransformer( |
||
| 70 | 'tool_visible_by_default_at_creation', |
||
| 71 | new ArrayToIdentifierTransformer() |
||
| 72 | ) |
||
| 73 | ; |
||
| 74 | |||
| 75 | $allowedTypes = [ |
||
| 76 | 'tool_visible_by_default_at_creation' => ['array'], |
||
| 77 | 'default_document_quotum' => ['string'], |
||
| 78 | 'default_group_quotum' => ['string'], |
||
| 79 | ]; |
||
| 80 | $this->setMultipleAllowedTypes($allowedTypes, $builder); |
||
| 81 | } |
||
| 223 |