Conditions | 1 |
Paths | 1 |
Total Lines | 62 |
Code Lines | 55 |
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 |
||
278 | protected function getElements(): array |
||
279 | { |
||
280 | return array ( |
||
281 | 'external_urls' => |
||
282 | array ( |
||
283 | 'name' => 'external_urls', |
||
284 | 'allownull' => true, |
||
285 | 'default' => '', |
||
286 | 'type' => '\\SpotifyApiConnect\\Domain\\DataTransferObject\\ExternalUrlDataProvider', |
||
287 | 'is_collection' => false, |
||
288 | 'is_dataprovider' => true, |
||
289 | 'isCamelCase' => false, |
||
290 | ), |
||
291 | 'id' => |
||
292 | array ( |
||
293 | 'name' => 'id', |
||
294 | 'allownull' => true, |
||
295 | 'default' => '', |
||
296 | 'type' => 'string', |
||
297 | 'is_collection' => false, |
||
298 | 'is_dataprovider' => false, |
||
299 | 'isCamelCase' => false, |
||
300 | ), |
||
301 | 'uri' => |
||
302 | array ( |
||
303 | 'name' => 'uri', |
||
304 | 'allownull' => true, |
||
305 | 'default' => '', |
||
306 | 'type' => 'string', |
||
307 | 'is_collection' => false, |
||
308 | 'is_dataprovider' => false, |
||
309 | 'isCamelCase' => false, |
||
310 | ), |
||
311 | 'type' => |
||
312 | array ( |
||
313 | 'name' => 'type', |
||
314 | 'allownull' => true, |
||
315 | 'default' => '', |
||
316 | 'type' => 'string', |
||
317 | 'is_collection' => false, |
||
318 | 'is_dataprovider' => false, |
||
319 | 'isCamelCase' => false, |
||
320 | ), |
||
321 | 'name' => |
||
322 | array ( |
||
323 | 'name' => 'name', |
||
324 | 'allownull' => true, |
||
325 | 'default' => '', |
||
326 | 'type' => 'string', |
||
327 | 'is_collection' => false, |
||
328 | 'is_dataprovider' => false, |
||
329 | 'isCamelCase' => false, |
||
330 | ), |
||
331 | 'href' => |
||
332 | array ( |
||
333 | 'name' => 'href', |
||
334 | 'allownull' => true, |
||
335 | 'default' => '', |
||
336 | 'type' => 'string', |
||
337 | 'is_collection' => false, |
||
338 | 'is_dataprovider' => false, |
||
339 | 'isCamelCase' => false, |
||
340 | ), |
||
344 |