| Conditions | 1 |
| Paths | 1 |
| Total Lines | 68 |
| Code Lines | 45 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| 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 |
||
| 62 | public function init() |
||
| 63 | { |
||
| 64 | $this->setName('atsMode'); |
||
| 65 | $this->add( |
||
| 66 | array( |
||
| 67 | 'type' => 'Select', |
||
| 68 | 'name' => 'mode', |
||
| 69 | 'options' => array( |
||
| 70 | 'label' => /*@translate*/ 'Mode', |
||
| 71 | 'value_options' => array( |
||
| 72 | 'intern' => /*@translate*/ 'Built-In ATS', |
||
| 73 | 'uri' => /*@translate*/ 'Use external link', |
||
| 74 | 'email' => /*@translate*/ 'Get applications via email', |
||
| 75 | 'none' => /*@translate*/ 'Do not track', |
||
| 76 | ), |
||
| 77 | ), |
||
| 78 | 'attributes' => array( |
||
| 79 | 'data-searchbox' => 'false', |
||
| 80 | 'value' => 'email', |
||
| 81 | ) |
||
| 82 | ) |
||
| 83 | ); |
||
| 84 | |||
| 85 | $this->add( |
||
| 86 | array( |
||
| 87 | 'type' => 'Text', |
||
| 88 | 'name' => 'uri', |
||
| 89 | 'options' => array( |
||
| 90 | 'label' => /*@translate*/ 'URL', |
||
| 91 | ) |
||
| 92 | ) |
||
| 93 | ); |
||
| 94 | |||
| 95 | $this->add( |
||
| 96 | array( |
||
| 97 | 'type' => 'Text', |
||
| 98 | 'name' => 'email', |
||
| 99 | 'options' => array( |
||
| 100 | 'label' => /*@translate*/ 'Email', |
||
| 101 | ), |
||
| 102 | ) |
||
| 103 | ); |
||
| 104 | |||
| 105 | $this->add([ |
||
| 106 | 'type' => 'Checkbox', |
||
| 107 | 'name' => 'oneClickApply', |
||
| 108 | 'options' => [ |
||
| 109 | 'label' => /*@translate*/ 'One click apply', |
||
| 110 | ] |
||
| 111 | ]); |
||
| 112 | |||
| 113 | $this->add([ |
||
| 114 | 'type' => 'Select', |
||
| 115 | 'name' => 'oneClickApplyProfiles', |
||
| 116 | 'options' => [ |
||
| 117 | 'label' => /*@translate*/ 'Social profiles', |
||
| 118 | 'value_options' => [ |
||
| 119 | 'facebook' => 'Facebook', |
||
| 120 | 'xing' => 'Xing', |
||
| 121 | 'linkedin' => 'LinkedIn' |
||
| 122 | ], |
||
| 123 | 'use_hidden_element' => true |
||
| 124 | ], |
||
| 125 | 'attributes' => [ |
||
| 126 | 'multiple' => true |
||
| 127 | ] |
||
| 128 | ]); |
||
| 129 | } |
||
| 130 | |||
| 147 |