Conditions | 1 |
Paths | 1 |
Total Lines | 61 |
Code Lines | 38 |
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 |
||
137 | private static function default_strings() { |
||
138 | |||
139 | return array( |
||
140 | |||
141 | '%s is required.' => |
||
142 | __( '%s is required.', 'pods' ), |
||
143 | |||
144 | 'This field is required.' => |
||
145 | __( 'This field is required.', 'pods' ), |
||
146 | |||
147 | 'Add' => |
||
148 | __( 'Add', 'pods' ), |
||
149 | |||
150 | 'Add New' => |
||
151 | __( 'Add New', 'pods' ), |
||
152 | |||
153 | 'Add New Record' => |
||
154 | __( 'Add New Record', 'pods' ), |
||
155 | |||
156 | 'Added!' => |
||
157 | __( 'Added!', 'pods' ), |
||
158 | |||
159 | 'Added! Choose another or <a href="#">close this box</a>' => |
||
160 | __( 'Added! Choose another or <a href="#">close this box</a>', 'pods' ), |
||
161 | |||
162 | 'Copy' => |
||
163 | __( 'Copy', 'pods' ), |
||
164 | |||
165 | 'Reorder' => |
||
166 | __( 'Reorder', 'pods' ), |
||
167 | |||
168 | 'Remove' => |
||
169 | __( 'Remove', 'pods' ), |
||
170 | |||
171 | 'Download' => |
||
172 | __( 'Download', 'pods' ), |
||
173 | |||
174 | 'View' => |
||
175 | __( 'View', 'pods' ), |
||
176 | |||
177 | 'Edit' => |
||
178 | __( 'Edit', 'pods' ), |
||
179 | |||
180 | 'Navigating away from this page will discard any changes you have made.' => |
||
181 | __( 'Navigating away from this page will discard any changes you have made.', 'pods' ), |
||
182 | |||
183 | 'Unable to process request, please try again.' => |
||
184 | __( 'Unable to process request, please try again.', 'pods' ), |
||
185 | |||
186 | 'There was an issue with the file upload, please try again.' => |
||
187 | __( 'There was an issue with the file upload, please try again.', 'pods' ), |
||
188 | |||
189 | 'Allowed Files' => |
||
190 | __( 'Allowed Files', 'pods' ), |
||
191 | |||
192 | 'The Title' => |
||
193 | __( 'The Title', 'pods' ), |
||
194 | |||
195 | ); |
||
196 | |||
197 | } |
||
198 | |||
200 |