Conditions | 1 |
Paths | 1 |
Total Lines | 226 |
Code Lines | 181 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
359 | protected static function attributesMetadata(): array |
||
360 | { |
||
361 | return array ( |
||
362 | 'parent' => |
||
363 | array ( |
||
364 | 'type' => |
||
365 | array ( |
||
366 | 0 => 'Transfer\\Simple\\SimpleObjectTransfer', |
||
367 | 1 => 'null', |
||
368 | ), |
||
369 | 'required' => false, |
||
370 | 'actionName' => 'parent', |
||
371 | ), |
||
372 | 'username' => |
||
373 | array ( |
||
374 | 'type' => |
||
375 | array ( |
||
376 | 0 => 'string', |
||
377 | 1 => 'null', |
||
378 | ), |
||
379 | 'required' => false, |
||
380 | 'actionName' => 'username', |
||
381 | ), |
||
382 | 'age' => |
||
383 | array ( |
||
384 | 'type' => |
||
385 | array ( |
||
386 | 0 => 'int', |
||
387 | 1 => 'null', |
||
388 | ), |
||
389 | 'required' => false, |
||
390 | 'actionName' => 'age', |
||
391 | ), |
||
392 | 'email' => |
||
393 | array ( |
||
394 | 'type' => |
||
395 | array ( |
||
396 | 0 => 'string', |
||
397 | 1 => 'null', |
||
398 | ), |
||
399 | 'required' => false, |
||
400 | 'actionName' => 'email', |
||
401 | ), |
||
402 | 'ip' => |
||
403 | array ( |
||
404 | 'type' => |
||
405 | array ( |
||
406 | 0 => 'string', |
||
407 | 1 => 'null', |
||
408 | ), |
||
409 | 'required' => false, |
||
410 | 'actionName' => 'ip', |
||
411 | ), |
||
412 | 'hostname' => |
||
413 | array ( |
||
414 | 'type' => |
||
415 | array ( |
||
416 | 0 => 'string', |
||
417 | 1 => 'null', |
||
418 | ), |
||
419 | 'required' => false, |
||
420 | 'actionName' => 'hostname', |
||
421 | ), |
||
422 | 'sometext' => |
||
423 | array ( |
||
424 | 'type' => |
||
425 | array ( |
||
426 | 0 => 'string', |
||
427 | 1 => 'null', |
||
428 | ), |
||
429 | 'required' => false, |
||
430 | 'actionName' => 'sometext', |
||
431 | ), |
||
432 | 'url' => |
||
433 | array ( |
||
434 | 'type' => |
||
435 | array ( |
||
436 | 0 => 'string', |
||
437 | 1 => 'null', |
||
438 | ), |
||
439 | 'required' => false, |
||
440 | 'actionName' => 'url', |
||
441 | ), |
||
442 | 'json' => |
||
443 | array ( |
||
444 | 'type' => |
||
445 | array ( |
||
446 | 0 => 'string', |
||
447 | 1 => 'null', |
||
448 | ), |
||
449 | 'required' => false, |
||
450 | 'actionName' => 'json', |
||
451 | ), |
||
452 | 'uuid' => |
||
453 | array ( |
||
454 | 'type' => |
||
455 | array ( |
||
456 | 0 => 'string', |
||
457 | 1 => 'null', |
||
458 | ), |
||
459 | 'required' => false, |
||
460 | 'actionName' => 'uuid', |
||
461 | ), |
||
462 | 'created_at' => |
||
463 | array ( |
||
464 | 'type' => |
||
465 | array ( |
||
466 | 0 => 'string', |
||
467 | 1 => 'null', |
||
468 | ), |
||
469 | 'required' => false, |
||
470 | 'actionName' => 'createdAt', |
||
471 | ), |
||
472 | 'updated_at' => |
||
473 | array ( |
||
474 | 'type' => |
||
475 | array ( |
||
476 | 0 => 'string', |
||
477 | 1 => 'null', |
||
478 | ), |
||
479 | 'required' => false, |
||
480 | 'actionName' => 'updatedAt', |
||
481 | ), |
||
482 | 'timezone' => |
||
483 | array ( |
||
484 | 'type' => |
||
485 | array ( |
||
486 | 0 => 'string', |
||
487 | 1 => 'null', |
||
488 | ), |
||
489 | 'required' => false, |
||
490 | 'actionName' => 'timezone', |
||
491 | ), |
||
492 | 'card_scheme' => |
||
493 | array ( |
||
494 | 'type' => |
||
495 | array ( |
||
496 | 0 => 'string', |
||
497 | 1 => 'null', |
||
498 | ), |
||
499 | 'required' => false, |
||
500 | 'actionName' => 'cardScheme', |
||
501 | ), |
||
502 | 'bic' => |
||
503 | array ( |
||
504 | 'type' => |
||
505 | array ( |
||
506 | 0 => 'string', |
||
507 | 1 => 'null', |
||
508 | ), |
||
509 | 'required' => false, |
||
510 | 'actionName' => 'bic', |
||
511 | ), |
||
512 | 'currency' => |
||
513 | array ( |
||
514 | 'type' => |
||
515 | array ( |
||
516 | 0 => 'string', |
||
517 | 1 => 'null', |
||
518 | ), |
||
519 | 'required' => false, |
||
520 | 'actionName' => 'currency', |
||
521 | ), |
||
522 | 'iban' => |
||
523 | array ( |
||
524 | 'type' => |
||
525 | array ( |
||
526 | 0 => 'string', |
||
527 | 1 => 'null', |
||
528 | ), |
||
529 | 'required' => false, |
||
530 | 'actionName' => 'iban', |
||
531 | ), |
||
532 | 'isbn' => |
||
533 | array ( |
||
534 | 'type' => |
||
535 | array ( |
||
536 | 0 => 'string', |
||
537 | 1 => 'null', |
||
538 | ), |
||
539 | 'required' => false, |
||
540 | 'actionName' => 'isbn', |
||
541 | ), |
||
542 | 'issn' => |
||
543 | array ( |
||
544 | 'type' => |
||
545 | array ( |
||
546 | 0 => 'string', |
||
547 | 1 => 'null', |
||
548 | ), |
||
549 | 'required' => false, |
||
550 | 'actionName' => 'issn', |
||
551 | ), |
||
552 | 'isin' => |
||
553 | array ( |
||
554 | 'type' => |
||
555 | array ( |
||
556 | 0 => 'string', |
||
557 | 1 => 'null', |
||
558 | ), |
||
559 | 'required' => false, |
||
560 | 'actionName' => 'isin', |
||
561 | ), |
||
562 | 'choice' => |
||
563 | array ( |
||
564 | 'type' => |
||
565 | array ( |
||
566 | 0 => 'string', |
||
567 | 1 => 'int', |
||
568 | 2 => 'float', |
||
569 | 3 => 'array', |
||
570 | 4 => 'null', |
||
571 | ), |
||
572 | 'required' => false, |
||
573 | 'actionName' => 'choice', |
||
574 | ), |
||
575 | 'expression' => |
||
576 | array ( |
||
577 | 'type' => |
||
578 | array ( |
||
579 | 0 => 'string', |
||
580 | 1 => 'int', |
||
581 | 2 => 'null', |
||
582 | ), |
||
583 | 'required' => false, |
||
584 | 'actionName' => 'expression', |
||
585 | ), |
||
589 |