| Conditions | 1 |
| Paths | 1 |
| Total Lines | 62 |
| Code Lines | 44 |
| 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 |
||
| 25 | public function init() |
||
| 26 | { |
||
| 27 | $this->setForms([ |
||
| 28 | 'professions' => [ |
||
| 29 | 'options' => [ |
||
| 30 | 'label' => 'Professions', |
||
| 31 | ], |
||
| 32 | 'entity' => 'professions', |
||
| 33 | 'property' => true, |
||
| 34 | 'forms' => [ |
||
| 35 | 'professions' => [ |
||
| 36 | 'type' => 'Core/Tree/Management', |
||
| 37 | 'property' => true, |
||
| 38 | 'options' => [ |
||
| 39 | 'enable_descriptions' => true, |
||
| 40 | 'description' => /*@translate*/ 'Manage the professions you want to assign to jobs.' . |
||
| 41 | /*@translate*/ 'The order of categories can be modified by drag&drop.', |
||
| 42 | 'display_mode' => SummaryForm::DISPLAY_SUMMARY, |
||
| 43 | ], |
||
| 44 | ], |
||
| 45 | ], |
||
| 46 | ], |
||
| 47 | 'industries' => [ |
||
| 48 | 'options' => [ |
||
| 49 | 'label' => 'Industries', |
||
| 50 | ], |
||
| 51 | 'entity' => 'industries', |
||
| 52 | 'property' => true, |
||
| 53 | 'forms' => [ |
||
| 54 | 'industries' => [ |
||
| 55 | 'type' => 'Core/Tree/Management', |
||
| 56 | 'property' => true, |
||
| 57 | 'options' => [ |
||
| 58 | 'enable_descriptions' => true, |
||
| 59 | 'description' => /*@translate*/ 'Manage the industries you want to assign to jobs.' . |
||
| 60 | /*@translate*/ 'The order of categories can be modified by drag&drop.', |
||
| 61 | 'display_mode' => SummaryForm::DISPLAY_SUMMARY, |
||
| 62 | ], |
||
| 63 | ], |
||
| 64 | ], |
||
| 65 | ], |
||
| 66 | 'employmentTypes' => [ |
||
| 67 | 'options' => [ |
||
| 68 | 'label' => 'Employment Types', |
||
| 69 | ], |
||
| 70 | 'entity' => 'employmentTypes', |
||
| 71 | 'property' => true, |
||
| 72 | 'forms' => [ |
||
| 73 | 'employmentTypes' => [ |
||
| 74 | 'type' => 'Core/Tree/Management', |
||
| 75 | 'property' => true, |
||
| 76 | 'options' => [ |
||
| 77 | 'enable_descriptions' => true, |
||
| 78 | 'description' => /*@translate*/ 'Manage the employment types you want to assign to jobs.'. |
||
| 79 | /*@translate*/ 'The order of categories can be modified by drag&drop.', |
||
| 80 | 'display_mode' => SummaryForm::DISPLAY_SUMMARY, |
||
| 81 | ], |
||
| 82 | ], |
||
| 83 | ], |
||
| 84 | ], |
||
| 85 | ]); |
||
| 86 | } |
||
| 87 | } |
||
| 88 |