| Conditions | 1 |
| Paths | 1 |
| Total Lines | 83 |
| Code Lines | 42 |
| 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 |
||
| 30 | public function init() |
||
| 31 | { |
||
| 32 | $this->setForms( |
||
| 33 | array( |
||
| 34 | 'descriptionFormDescription' => array( |
||
| 35 | 'type' => 'Jobs/JobDescriptionDescription', |
||
| 36 | 'property' => true, |
||
| 37 | ) |
||
| 38 | ) |
||
| 39 | ); |
||
| 40 | |||
| 41 | $this->setForms( |
||
| 42 | array( |
||
| 43 | 'descriptionFormBenefits' => array( |
||
| 44 | 'type' => 'Jobs/JobDescriptionBenefits', |
||
| 45 | 'property' => true, |
||
| 46 | ) |
||
| 47 | ) |
||
| 48 | ); |
||
| 49 | |||
| 50 | $this->setForms( |
||
| 51 | [ |
||
| 52 | 'templateLabelBenefits' => [ |
||
| 53 | 'type' => 'Jobs/TemplateLabelBenefits', |
||
| 54 | 'property' => true, |
||
| 55 | ] |
||
| 56 | ] |
||
| 57 | ); |
||
| 58 | |||
| 59 | $this->setForms( |
||
| 60 | array( |
||
| 61 | 'descriptionFormRequirements' => array( |
||
| 62 | 'type' => 'Jobs/JobDescriptionRequirements', |
||
| 63 | 'property' => true, |
||
| 64 | ) |
||
| 65 | ) |
||
| 66 | ); |
||
| 67 | |||
| 68 | $this->setForms( |
||
| 69 | [ |
||
| 70 | 'templateLabelRequirements' => [ |
||
| 71 | 'type' => 'Jobs/TemplateLabelRequirements', |
||
| 72 | 'property' => true, |
||
| 73 | ] |
||
| 74 | ] |
||
| 75 | ); |
||
| 76 | |||
| 77 | $this->setForms( |
||
| 78 | array( |
||
| 79 | 'descriptionFormQualifications' => array( |
||
| 80 | 'type' => 'Jobs/JobDescriptionQualifications', |
||
| 81 | 'property' => true, |
||
| 82 | ) |
||
| 83 | ) |
||
| 84 | ); |
||
| 85 | |||
| 86 | $this->setForms( |
||
| 87 | [ |
||
| 88 | 'templateLabelQualifications' => [ |
||
| 89 | 'type' => 'Jobs/TemplateLabelQualifications', |
||
| 90 | 'property' => true, |
||
| 91 | ] |
||
| 92 | ] |
||
| 93 | ); |
||
| 94 | |||
| 95 | $this->setForms( |
||
| 96 | array( |
||
| 97 | 'descriptionFormTitle' => array( |
||
| 98 | 'type' => 'Jobs/JobDescriptionTitle', |
||
| 99 | 'property' => true, |
||
| 100 | ) |
||
| 101 | ) |
||
| 102 | ); |
||
| 103 | |||
| 104 | $this->setForms([ |
||
| 105 | 'descriptionFormHtml' => [ |
||
| 106 | 'type' => 'Jobs/JobDescriptionHtml', |
||
| 107 | 'property' => true, |
||
| 108 | ], |
||
| 109 | ]); |
||
| 110 | |||
| 111 | |||
| 112 | } |
||
| 113 | } |
||
| 114 |