| Conditions | 1 |
| Paths | 1 |
| Total Lines | 52 |
| Code Lines | 40 |
| 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 |
||
| 19 | public function up(Schema $schema) |
||
| 20 | { |
||
| 21 | $this->addSettingCurrent( |
||
| 22 | 'cron_remind_course_expiration_activate', |
||
| 23 | null, |
||
| 24 | 'radio', |
||
| 25 | 'Crons', |
||
| 26 | 'false', |
||
| 27 | 'CronRemindCourseExpirationActivateTitle', |
||
| 28 | 'CronRemindCourseExpirationActivateComment', |
||
| 29 | null, |
||
| 30 | null, |
||
| 31 | 1, |
||
| 32 | true, |
||
| 33 | false, |
||
| 34 | [ |
||
| 35 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
| 36 | 1 => ['value' => 'false', 'text' => 'No'] |
||
| 37 | ] |
||
| 38 | ); |
||
| 39 | |||
| 40 | $this->addSettingCurrent( |
||
| 41 | 'cron_remind_course_expiration_frequency', |
||
| 42 | null, |
||
| 43 | 'textfield', |
||
| 44 | 'Crons', |
||
| 45 | '2', |
||
| 46 | 'CronRemindCourseExpirationFrecuenqyTitle', |
||
| 47 | 'CronRemindCourseExpirationFrecuenqyComment', |
||
| 48 | null, |
||
| 49 | null, |
||
| 50 | 1, |
||
| 51 | true, |
||
| 52 | false |
||
| 53 | ); |
||
| 54 | |||
| 55 | $this->addSettingCurrent( |
||
| 56 | 'cron_course_finished_activate', |
||
| 57 | null, |
||
| 58 | 'radio', |
||
| 59 | 'Crons', |
||
| 60 | 'false', |
||
| 61 | 'CronCourseFinishedActivateTitle', |
||
| 62 | 'CronCourseFinishedActivateComment', |
||
| 63 | null, |
||
| 64 | null, |
||
| 65 | 1, |
||
| 66 | true, |
||
| 67 | false, |
||
| 68 | [ |
||
| 69 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
| 70 | 1 => ['value' => 'false', 'text' => 'No'] |
||
| 71 | ] |
||
| 112 |