| Conditions | 1 |
| Paths | 1 |
| Total Lines | 51 |
| Code Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 6 | ||
| Bugs | 0 | Features | 1 |
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 |
||
| 28 | public function init() |
||
| 29 | { |
||
| 30 | $this->setName('cv-form'); |
||
| 31 | |||
| 32 | $this->setForms(array( |
||
| 33 | 'contact' => array( |
||
| 34 | 'type' => 'Auth/UserInfo', |
||
| 35 | 'property' => 'contact' |
||
| 36 | ), |
||
| 37 | 'image' => array( |
||
| 38 | 'type' => 'CvContactImage', |
||
| 39 | 'property' => 'contact', |
||
| 40 | 'use_files_array' => true |
||
| 41 | ), |
||
| 42 | 'preferredJob' => array( |
||
| 43 | 'type' => 'Cv/PreferredJobForm', |
||
| 44 | 'property' => 'preferredJob', |
||
| 45 | 'options' => array( |
||
| 46 | 'is_disable_capable' => true, |
||
| 47 | 'is_disable_elements_capable' => true, |
||
| 48 | 'enable_descriptions' => true, |
||
| 49 | 'description' => /*@translate*/ 'Where do you want to work tomorrow. This heading gives an immediate overview of your desired next job.', |
||
| 50 | ), |
||
| 51 | |||
| 52 | ), |
||
| 53 | 'employments' => array( |
||
| 54 | 'type' => 'CvEmploymentCollection', |
||
| 55 | 'property' => 'employmentsIndexedById' |
||
| 56 | ), |
||
| 57 | 'educations' => array( |
||
| 58 | 'type' => 'CvEducationCollection', |
||
| 59 | 'property' => 'educationsIndexedById' |
||
| 60 | ), |
||
| 61 | 'nativeLanguage' => [ |
||
| 62 | 'type' => 'Cv/NativeLanguageForm', |
||
| 63 | 'property' => true, |
||
| 64 | 'options' => array( |
||
| 65 | 'enable_descriptions' => true, |
||
| 66 | 'description' => /*@translate*/ 'Select from list or enter your mother tongue.', |
||
| 67 | ), |
||
| 68 | ], |
||
| 69 | 'languageSkills' => [ |
||
| 70 | 'type' => 'Cv/LanguageSkillCollection', |
||
| 71 | 'property' => 'languageSkillsIndexedById', |
||
| 72 | ], |
||
| 73 | 'skills' => array( |
||
| 74 | 'type' => 'CvSkillCollection', |
||
| 75 | 'property' => 'skillsIndexedById' |
||
| 76 | ) |
||
| 77 | )); |
||
| 78 | } |
||
| 79 | } |
||
| 80 |