| Conditions | 3 |
| Paths | 2 |
| Total Lines | 78 |
| Code Lines | 60 |
| 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 |
||
| 113 | public function setupUpdateOperation() |
||
|
1 ignored issue
–
show
|
|||
| 114 | { |
||
| 115 | $this->crud->addField([ |
||
| 116 | 'name' => 'title', |
||
| 117 | 'label' => 'Title', |
||
| 118 | 'type' => 'text', |
||
| 119 | 'attributes' => [ |
||
| 120 | 'readonly' => 'readonly' |
||
| 121 | ] |
||
| 122 | ]); |
||
| 123 | $this->crud->addField([ |
||
| 124 | 'name' => 'salary_min', |
||
| 125 | 'type' => 'number', |
||
| 126 | 'label' => 'Minimum Salary', |
||
| 127 | ]); |
||
| 128 | $this->crud->addField([ |
||
| 129 | 'name' => 'salary_max', |
||
| 130 | 'type' => 'number', |
||
| 131 | 'label' => 'Maximum Salary', |
||
| 132 | ]); |
||
| 133 | $this->crud->addField([ |
||
| 134 | 'name' => 'noc', |
||
| 135 | 'type' => 'number', |
||
| 136 | 'label' => 'NOC Code', |
||
| 137 | ]); |
||
| 138 | $this->crud->addField([ |
||
| 139 | 'name' => 'open_date_time', |
||
| 140 | 'label' => 'Open Date', |
||
| 141 | 'type' => 'date_picker', |
||
| 142 | 'date_picker_options' => [ |
||
| 143 | 'todayBtn' => 'linked', |
||
| 144 | 'format' => 'yyyy-mm-dd', |
||
| 145 | ], |
||
| 146 | ]); |
||
| 147 | $this->crud->addField([ |
||
| 148 | 'name' => 'close_date_time', |
||
| 149 | 'label' => 'Close Date', |
||
| 150 | 'type' => 'date_picker', |
||
| 151 | 'date_picker_options' => [ |
||
| 152 | 'todayBtn' => 'linked', |
||
| 153 | 'format' => 'yyyy-mm-dd', |
||
| 154 | ], |
||
| 155 | ]); |
||
| 156 | $this->crud->addField([ |
||
| 157 | 'name' => 'start_date_time', |
||
| 158 | 'label' => 'Start Date', |
||
| 159 | 'type' => 'date_picker', |
||
| 160 | 'date_picker_options' => [ |
||
| 161 | 'todayBtn' => 'linked', |
||
| 162 | 'format' => 'yyyy-mm-dd', |
||
| 163 | ], |
||
| 164 | ]); |
||
| 165 | $this->crud->addField([ |
||
| 166 | 'name' => 'process_number', |
||
| 167 | 'type' => 'number', |
||
| 168 | 'label' => 'Process #', |
||
| 169 | ]); |
||
| 170 | $this->crud->addField([ |
||
| 171 | 'name' => 'priority_clearance_number', |
||
| 172 | 'type' => 'number', |
||
| 173 | 'label' => 'Priority Clearance #', |
||
| 174 | ]); |
||
| 175 | $this->crud->addField([ |
||
| 176 | 'name' => 'loo_issuance_date', |
||
| 177 | 'type' => 'date_picker', |
||
| 178 | 'label' => 'Letter of Offer Issuance Date', |
||
| 179 | 'date_picker_options' => [ |
||
| 180 | 'todayBtn' => 'linked', |
||
| 181 | 'format' => 'yyyy-mm-dd', |
||
| 182 | ], |
||
| 183 | ]); |
||
| 184 | if ($this->crud->getCurrentEntry() && |
||
| 185 | !$this->crud->getCurrentEntry()->published |
||
| 186 | ) { |
||
| 187 | $this->crud->addField([ |
||
| 188 | 'name' => 'published', |
||
| 189 | 'label' => 'Publish', |
||
| 190 | 'type' => 'checkbox' |
||
| 191 | ]); |
||
| 215 |