| Conditions | 1 |
| Paths | 1 |
| Total Lines | 85 |
| Code Lines | 52 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| 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 |
||
| 40 | public function init() |
||
| 41 | { |
||
| 42 | $this->setName('emails') |
||
| 43 | ->setLabel(/* @translate */ 'E-Mail Notifications'); |
||
| 44 | |||
| 45 | $this->add( |
||
| 46 | array('type' => 'Zend\Form\Element\Checkbox', |
||
| 47 | 'name' => 'mailAccess', |
||
| 48 | 'options' => array('label' => /* @translate */ 'receive E-Mail alert', |
||
| 49 | 'long_label' => /* @translate */ 'if checked, you\'ll be informed by mail about new applications.'), |
||
| 50 | ) |
||
| 51 | ); |
||
| 52 | $this->add( |
||
| 53 | array('type' => 'Zend\Form\Element\Textarea', |
||
| 54 | 'name' => 'mailAccessText', |
||
| 55 | 'options' => array('label' => /* @translate */ 'Mailtext', |
||
| 56 | 'description' => /* @translate */ 'default text of the notification mail about new applications. The following variables can be used:<ul><li>##name## = your name</li><li>##title## = title of the job</li></ul>')) |
||
| 57 | ); |
||
| 58 | |||
| 59 | $this->add( |
||
| 60 | array('type' => 'Zend\Form\Element\Checkbox', |
||
| 61 | 'name' => 'autoConfirmMail', |
||
| 62 | 'options' => array('label' => /* @translate */ 'confirm application immidiatly after submit', |
||
| 63 | 'long_label' => /* @translate */ 'if checked, an application is immediatly confirmed. If unchecked confirmation is the duty of the recruiter.'), |
||
| 64 | ) |
||
| 65 | ); |
||
| 66 | $this->add( |
||
| 67 | array('type' => 'Zend\Form\Element\Textarea', |
||
| 68 | 'name' => 'mailConfirmationText', |
||
| 69 | 'options' => array('label' => /* @translate */ 'Confirmation mail text', |
||
| 70 | 'description' => /* @translate */ 'default text of the acknowledgment of receipt mail to the applicant. The following variables can be used:<br><ul><li>##anrede_formell## = salutation. Includes gender, firstname and lastname.<li>##anrede_informell## = salutation. Includes fistname and lastname.</li><li>##job_title## = title of the jobs</li><li>##name## = name of the applicant.</li><li>##date## = date of recipt of the application.</li></ul>' )) |
||
| 71 | ); |
||
| 72 | |||
| 73 | $this->add( |
||
| 74 | array('type' => 'Zend\Form\Element\Textarea', |
||
| 75 | 'name' => 'mailInvitationText', |
||
| 76 | 'options' => array('label' => /* @translate */ 'Invitation mail text', |
||
| 77 | 'description'=> /* @translate */ 'default text of the invitation mail to the applicant. You can use all variables of the acknowledgment of receipt mail. ' |
||
| 78 | )) |
||
| 79 | ); |
||
| 80 | |||
| 81 | $this->add( |
||
| 82 | [ |
||
| 83 | 'type' => 'Zend\Form\Element\Textarea', |
||
| 84 | 'name' => 'mailAcceptedText', |
||
| 85 | 'options' => [ |
||
| 86 | 'label' => /* @translate */ 'Accept mail text', |
||
| 87 | 'description'=> /* @translate */ 'default text, when accepting an applicant. This mail is send to by a domain admin to the recruiter, who is responsible for the job posting.' |
||
| 88 | ] |
||
| 89 | ] |
||
| 90 | ); |
||
| 91 | |||
| 92 | $this->add( |
||
| 93 | [ |
||
| 94 | 'type' => 'Zend\Form\Element\Textarea', |
||
| 95 | 'name' => 'mailRejectionText', |
||
| 96 | 'options' => [ |
||
| 97 | 'label' => /* @translate */ 'Rejection mail text', |
||
| 98 | 'description' => /* @translate */ 'default text of the refusal of an application to the applicant. You can use all variables of the acknowledgment of receipt mail.' |
||
| 99 | ] |
||
| 100 | ] |
||
| 101 | ); |
||
| 102 | |||
| 103 | $this->add( |
||
| 104 | [ |
||
| 105 | 'type' => 'Zend\Form\Element\Checkbox', |
||
| 106 | 'name' => 'mailBCC', |
||
| 107 | 'options' => [ |
||
| 108 | 'label' => /* @translate */ 'get blind carbon copy of all own mails', |
||
| 109 | 'long_label' => /* @translate */ 'if checked, you\'ll get a copy of all mails you send.', |
||
| 110 | 'value_options' => [0, 1, true, false] |
||
| 111 | ] |
||
| 112 | ] |
||
| 113 | ); |
||
| 114 | |||
| 115 | $this->add( |
||
| 116 | array( |
||
| 117 | 'type' => 'Settings/DisableElementsCapableFormSettingsFieldset', |
||
| 118 | 'name' => 'applyFormSettings', |
||
| 119 | 'options' => array( |
||
| 120 | |||
| 121 | ) |
||
| 122 | ) |
||
| 123 | ); |
||
| 124 | } |
||
| 125 | } |
||
| 126 |