| Conditions | 1 |
| Paths | 1 |
| Total Lines | 60 |
| Code Lines | 38 |
| 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 |
||
| 21 | public function buildSettings(SettingsBuilderInterface $builder) |
||
| 22 | { |
||
| 23 | $builder |
||
| 24 | ->setDefaults( |
||
| 25 | [ |
||
| 26 | 'institution' => 'Chamilo.org', |
||
| 27 | 'institution_url' => 'http://www.chamilo.org', |
||
| 28 | 'institution_address' => '', |
||
| 29 | 'site_name' => 'Chamilo site', |
||
| 30 | // 'administrator_email' => '[email protected]', |
||
| 31 | // 'administrator_name' => 'Jane', |
||
| 32 | // 'administrator_surname' => 'Doe', |
||
| 33 | // 'administrator_phone' => '123456', |
||
| 34 | 'timezone' => 'Europe/Paris', |
||
| 35 | 'theme' => 'chamilo', |
||
| 36 | 'gravatar_enabled' => 'false', |
||
| 37 | 'gravatar_type' => 'mm', |
||
| 38 | 'gamification_mode' => ' ', |
||
| 39 | 'order_user_list_by_official_code' => 'false', |
||
| 40 | 'cookie_warning' => 'false', |
||
| 41 | 'donotlistcampus' => 'false', |
||
| 42 | 'catalog_show_courses_sessions' => '0', |
||
| 43 | 'course_catalog_hide_private' => 'false', |
||
| 44 | 'use_custom_pages' => 'false', |
||
| 45 | 'pdf_logo_header' => '', |
||
| 46 | 'allow_my_files' => 'true', |
||
| 47 | 'chamilo_database_version' => '2.0.0', |
||
| 48 | 'registered' => 'false', |
||
| 49 | 'load_term_conditions_section' => 'login', |
||
| 50 | 'server_type' => 'false', |
||
| 51 | 'show_full_skill_name_on_skill_wheel' => 'false', |
||
| 52 | 'show_official_code_whoisonline' => 'false', |
||
| 53 | 'show_tabs' => [] |
||
| 54 | // |
||
| 55 | //('catalog_show_courses_sessions', '0', 'CatalogueShowOnlyCourses'), |
||
| 56 | //('catalog_show_courses_sessions', '1', 'CatalogueShowOnlySessions'), |
||
| 57 | //('catalog_show_courses_sessions', '2', 'CatalogueShowCoursesAndSessions'), |
||
| 58 | ] |
||
| 59 | ) |
||
| 60 | ->setTransformer( |
||
| 61 | 'show_tabs', |
||
| 62 | new ArrayToIdentifierTransformer() |
||
| 63 | ) |
||
| 64 | ; |
||
| 65 | $allowedTypes = [ |
||
| 66 | 'institution' => ['string'], |
||
| 67 | 'institution_url' => ['string'], |
||
| 68 | 'site_name' => ['string'], |
||
| 69 | // 'administrator_email' => array('string'), |
||
| 70 | // 'administrator_name' => array('string'), |
||
| 71 | // 'administrator_surname' => array('string'), |
||
| 72 | // 'administrator_phone' => array('string'), |
||
| 73 | 'timezone' => ['string'], |
||
| 74 | 'gravatar_enabled' => ['string'], |
||
| 75 | 'gravatar_type' => ['string'], |
||
| 76 | 'show_tabs' => ['array'] |
||
| 77 | //'gamification_mode' => array('string'), |
||
| 78 | ]; |
||
| 79 | |||
| 80 | $this->setMultipleAllowedTypes($allowedTypes, $builder); |
||
| 81 | } |
||
| 170 |