| Conditions | 1 |
| Paths | 1 |
| Total Lines | 80 |
| Code Lines | 55 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 2 |
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 |
||
| 35 | public function init() |
||
| 36 | { |
||
| 37 | $this->setHydrator(new \Core\Entity\Hydrator\EntityHydrator()) |
||
| 38 | ->setName('base'); |
||
| 39 | |||
| 40 | $this->add( |
||
| 41 | array( |
||
| 42 | 'name' => 'willingnessToTravel', |
||
| 43 | 'type' => '\Zend\Form\Element\Select', |
||
| 44 | 'options' => array( |
||
| 45 | 'value_options' => array( |
||
| 46 | '' => '', // needed for jquery select2 to render the placeholder |
||
| 47 | "yes"=>/*@translate*/ "Yes", |
||
| 48 | "conditioned" => /*@translate*/ "conditioned", |
||
| 49 | "no"=>/*@translate*/ "No"), |
||
| 50 | 'label' => /*@translate*/ 'Willingness to travel', |
||
| 51 | 'description' => /*@translate*/ 'Enter your willingness to travel.', |
||
| 52 | 'disable_capable' => array( |
||
| 53 | 'description' => /*@translate*/ 'Ask the applicant about the willingness to travel', |
||
| 54 | ), |
||
| 55 | ), |
||
| 56 | 'attributes' => array( |
||
| 57 | 'data-placeholder' => /*@translate*/ 'please select', |
||
| 58 | 'data-allowclear' => 'false', |
||
| 59 | 'data-searchbox' => -1, |
||
| 60 | ), |
||
| 61 | ) |
||
| 62 | ); |
||
| 63 | |||
| 64 | $this->add( |
||
| 65 | array( |
||
| 66 | 'name' => 'earliestStartingDate', |
||
| 67 | 'type' => "date", |
||
| 68 | 'options' => array( |
||
| 69 | 'label' => /*@translate*/ 'Earliest starting date', |
||
| 70 | 'description' => /*@translate*/ 'Enter the earliest starting date.', |
||
| 71 | 'disable_capable' => array( |
||
| 72 | 'description' => /*@translate*/ 'Ask the applicant about the earliest starting date.', |
||
| 73 | ), |
||
| 74 | ), |
||
| 75 | ) |
||
| 76 | ); |
||
| 77 | |||
| 78 | $this->add( |
||
| 79 | array( |
||
| 80 | 'name' => 'expectedSalary', |
||
| 81 | 'options' => array( |
||
| 82 | 'label' => /*@translate*/ 'Expected salary', |
||
| 83 | 'description' => /*@translate*/ 'Your salary requirements should be the annual amount before taxes. Do not forget to provide the currency sign.', |
||
| 84 | 'disable_capable' => array( |
||
| 85 | 'description' => /*@translate*/ 'Ask users about their expected salary.', |
||
| 86 | ), |
||
| 87 | ), |
||
| 88 | ) |
||
| 89 | ); |
||
| 90 | |||
| 91 | $this->add( |
||
| 92 | array( |
||
| 93 | 'name' => 'drivingLicense', |
||
| 94 | 'type' => '\Zend\Form\Element\Select', |
||
| 95 | 'options' => array( |
||
| 96 | 'value_options' => array( |
||
| 97 | '' => '', // needed for jquery select2 to render the placeholder |
||
| 98 | "1" =>/*@translate*/ "Yes", |
||
| 99 | "0" =>/*@translate*/ "No" |
||
| 100 | ), |
||
| 101 | 'label' => /*@translate*/ 'driving license', |
||
| 102 | 'description' => /*@translate*/ 'Do you have a driving license?', |
||
| 103 | 'disable_capable' => array( |
||
| 104 | 'description' => /*@translate*/ 'Ask the applicant, if he has a driving license.', |
||
| 105 | ), |
||
| 106 | ), |
||
| 107 | 'attributes' => [ |
||
| 108 | 'data-allowclear' => 'false', |
||
| 109 | 'data-searchbox' => -1, |
||
| 110 | 'data-placeholder' => /*@translate*/ 'please select', |
||
| 111 | ] |
||
| 112 | ) |
||
| 113 | ); |
||
| 114 | } |
||
| 115 | |||
| 207 |