| Conditions | 1 |
| Paths | 1 |
| Total Lines | 57 |
| Code Lines | 47 |
| 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 | 'default_document_quotum' => '1000', |
||
| 23 | 'default_group_quotum' => '250', |
||
| 24 | 'permanently_remove_deleted_files' => 'false', |
||
| 25 | 'upload_extensions_list_type' => 'blacklist', |
||
| 26 | 'upload_extensions_blacklist' => '', |
||
| 27 | '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', |
||
| 28 | 'upload_extensions_skip' => 'true', |
||
| 29 | 'upload_extensions_replace_by' => 'dangerous', |
||
| 30 | 'permissions_for_new_directories' => '0770', |
||
| 31 | 'permissions_for_new_files' => '0660', |
||
| 32 | 'students_download_folders' => 'true', |
||
| 33 | 'users_copy_files' => 'true', |
||
| 34 | 'pdf_export_watermark_enable' => 'false', |
||
| 35 | 'pdf_export_watermark_by_course' => 'false', |
||
| 36 | 'pdf_export_watermark_text' => '', |
||
| 37 | 'students_export2pdf' => 'true', |
||
| 38 | 'show_users_folders' => 'true', |
||
| 39 | 'show_default_folders' => 'true', |
||
| 40 | 'show_documents_preview' => 'false', |
||
| 41 | 'tool_visible_by_default_at_creation' => [ |
||
| 42 | 'documents', |
||
| 43 | 'learning_path', |
||
| 44 | 'links', |
||
| 45 | 'announcements', |
||
| 46 | 'forums', |
||
| 47 | 'quiz', |
||
| 48 | 'gradebook', |
||
| 49 | ], |
||
| 50 | 'documents_default_visibility_defined_in_course' => 'false', |
||
| 51 | 'send_notification_when_document_added' => 'false', |
||
| 52 | 'thematic_pdf_orientation' => 'landscape', |
||
| 53 | 'group_document_access' => 'false', |
||
| 54 | 'group_category_document_access' => 'false', |
||
| 55 | 'documents_hide_download_icon' => 'false', |
||
| 56 | 'enable_x_sendfile_headers' => 'false', |
||
| 57 | 'documents_custom_cloud_link_list' => '', |
||
| 58 | |||
| 59 | 'access_url_specific_files' => 'false', |
||
| 60 | 'video_features' => '', |
||
| 61 | ]) |
||
| 62 | ->setTransformer( |
||
| 63 | 'tool_visible_by_default_at_creation', |
||
| 64 | new ArrayToIdentifierTransformer() |
||
| 65 | ) |
||
| 66 | ; |
||
| 67 | |||
| 68 | $allowedTypes = [ |
||
| 69 | 'tool_visible_by_default_at_creation' => ['array'], |
||
| 70 | 'default_document_quotum' => ['string'], |
||
| 71 | 'default_group_quotum' => ['string'], |
||
| 72 | ]; |
||
| 73 | |||
| 74 | $this->setMultipleAllowedTypes($allowedTypes, $builder); |
||
| 75 | } |
||
| 150 |