Conditions | 1 |
Paths | 1 |
Total Lines | 107 |
Code Lines | 89 |
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 |
||
17 | public function up(Schema $schema) |
||
18 | { |
||
19 | $this->addSettingCurrent( |
||
20 | 'prevent_multiple_simultaneous_login', |
||
21 | null, |
||
22 | 'radio', |
||
23 | 'Security', |
||
24 | 'false', |
||
25 | 'PreventMultipleSimultaneousLoginTitle', |
||
26 | 'PreventMultipleSimultaneousLoginComment', |
||
27 | null, |
||
28 | null, |
||
29 | 1, |
||
30 | false, |
||
31 | true, |
||
32 | [ |
||
33 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
34 | 1 => ['value' => 'false', 'text' => 'No'] |
||
35 | ] |
||
36 | ); |
||
37 | $this->addSettingCurrent( |
||
38 | 'gradebook_detailed_admin_view', |
||
39 | null, |
||
40 | 'radio', |
||
41 | 'Gradebook', |
||
42 | 'false', |
||
43 | 'ShowAdditionalColumnsInStudentResultsPageTitle', |
||
44 | 'ShowAdditionalColumnsInStudentResultsPageComment', |
||
45 | null, |
||
46 | null, |
||
47 | 1, |
||
48 | true, |
||
49 | false, |
||
50 | [ |
||
51 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
52 | 1 => ['value' => 'false', 'text' => 'No'] |
||
53 | ] |
||
54 | ); |
||
55 | $this->addSettingCurrent( |
||
56 | 'course_catalog_published', |
||
57 | null, |
||
58 | 'radio', |
||
59 | 'Course', |
||
60 | 'false', |
||
61 | 'CourseCatalogIsPublicTitle', |
||
62 | 'CourseCatalogIsPublicComment', |
||
63 | null, |
||
64 | null, |
||
65 | 1, |
||
66 | false, |
||
67 | true, |
||
68 | [ |
||
69 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
70 | 1 => ['value' => 'false', 'text' => 'No'] |
||
71 | ] |
||
72 | ); |
||
73 | $this->addSettingCurrent( |
||
74 | 'user_reset_password', |
||
75 | null, |
||
76 | 'radio', |
||
77 | 'Security', |
||
78 | 'false', |
||
79 | 'ResetPasswordTokenTitle', |
||
80 | 'ResetPasswordTokenComment', |
||
81 | null, |
||
82 | null, |
||
83 | 1, |
||
84 | false, |
||
85 | true, |
||
86 | [ |
||
87 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
88 | 1 => ['value' => 'false', 'text' => 'No'] |
||
89 | ] |
||
90 | ); |
||
91 | $this->addSettingCurrent( |
||
92 | 'user_reset_password_token_limit', |
||
93 | null, |
||
94 | 'textfield', |
||
95 | 'Security', |
||
96 | '3600', |
||
97 | 'ResetPasswordTokenLimitTitle', |
||
98 | 'ResetPasswordTokenLimitComment', |
||
99 | null, |
||
100 | null, |
||
101 | 1, |
||
102 | false, |
||
103 | true |
||
104 | ); |
||
105 | $this->addSettingCurrent( |
||
106 | 'my_courses_view_by_session', |
||
107 | null, |
||
108 | 'radio', |
||
109 | 'Session', |
||
110 | 'false', |
||
111 | 'ViewMyCoursesListBySessionTitle', |
||
112 | 'ViewMyCoursesListBySessionComment', |
||
113 | null, |
||
114 | null, |
||
115 | 1, |
||
116 | true, |
||
117 | false, |
||
118 | [ |
||
119 | 0 => ['value' => 'true', 'text' => 'Yes'], |
||
120 | 1 => ['value' => 'false', 'text' => 'No'] |
||
121 | ] |
||
122 | ); |
||
123 | } |
||
124 | |||
167 |