Conditions | 1 |
Paths | 1 |
Total Lines | 144 |
Code Lines | 93 |
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 |
||
468 | protected static function initPropertyMapDefinition() { |
||
469 | static::$propertyMapDefinition |
||
470 | ->addPropertyMap( |
||
471 | new PropertyDefinition('idTeam'), |
||
472 | new PropertyDefinition('id') |
||
473 | ) |
||
474 | ->addPropertyMap( |
||
475 | new PropertyDefinition('strTeam'), |
||
476 | new PropertyDefinition('name') |
||
477 | ) |
||
478 | ->addPropertyMap( |
||
479 | new PropertyDefinition('strTeamShort'), |
||
480 | new PropertyDefinition('teamShort') |
||
481 | ) |
||
482 | ->addPropertyMap( |
||
483 | new PropertyDefinition('strAlternateName'), |
||
484 | new PropertyDefinition('alternateName') |
||
485 | ) |
||
486 | ->addPropertyMap( |
||
487 | new PropertyDefinition('strFormedYear'), |
||
488 | new PropertyDefinition('formedYear') |
||
489 | ) |
||
490 | ->addPropertyMap( |
||
491 | new PropertyDefinition('strSport'), |
||
492 | new PropertyDefinition('sport', 'sport'), |
||
493 | [self::class, 'transformSport'], |
||
494 | [Sport::class, 'reverse'] |
||
495 | ) |
||
496 | ->addPropertyMap( |
||
497 | new PropertyDefinition('idLeague'), |
||
498 | new PropertyDefinition('league', 'league'), |
||
499 | [self::class, 'transformLeague'], |
||
500 | [League::class, 'reverse'] |
||
501 | ) |
||
502 | ->addPropertyMap( |
||
503 | new PropertyDefinition('strDivision'), |
||
504 | new PropertyDefinition('division') |
||
505 | ) |
||
506 | ->addPropertyMap( |
||
507 | new PropertyDefinition('strManager'), |
||
508 | new PropertyDefinition('manager') |
||
509 | ) |
||
510 | ->addPropertyMap( |
||
511 | new PropertyDefinition('strStadium'), |
||
512 | new PropertyDefinition('stadium') |
||
513 | ) |
||
514 | ->addPropertyMap( |
||
515 | new PropertyDefinition('strKeywords'), |
||
516 | new PropertyDefinition('keywords') |
||
517 | ) |
||
518 | ->addPropertyMap( |
||
519 | new PropertyDefinition('strRSS'), |
||
520 | new PropertyDefinition('rss') |
||
521 | ) |
||
522 | ->addPropertyMap( |
||
523 | new PropertyDefinition('strStadiumThumb'), |
||
524 | new PropertyDefinition('stadiumThumb') |
||
525 | ) |
||
526 | ->addPropertyMap( |
||
527 | new PropertyDefinition('strStadiumDescription'), |
||
528 | new PropertyDefinition('stadiumDescription') |
||
529 | ) |
||
530 | ->addPropertyMap( |
||
531 | new PropertyDefinition('strStadiumLocation'), |
||
532 | new PropertyDefinition('stadiumLocation') |
||
533 | ) |
||
534 | ->addPropertyMap( |
||
535 | new PropertyDefinition('intStadiumCapacity'), |
||
536 | new PropertyDefinition('stadiumCapacity') |
||
537 | ) |
||
538 | ->addPropertyMap( |
||
539 | new PropertyDefinition('strWebsite'), |
||
540 | new PropertyDefinition('website') |
||
541 | ) |
||
542 | ->addPropertyMap( |
||
543 | new PropertyDefinition('strFacebook'), |
||
544 | new PropertyDefinition('facebook') |
||
545 | ) |
||
546 | ->addPropertyMap( |
||
547 | new PropertyDefinition('strTwitter'), |
||
548 | new PropertyDefinition('twitter') |
||
549 | ) |
||
550 | ->addPropertyMap( |
||
551 | new PropertyDefinition('strInstagram'), |
||
552 | new PropertyDefinition('instagram') |
||
553 | ) |
||
554 | ->addPropertyMap( |
||
555 | new PropertyDefinition('strDescriptionEN'), |
||
556 | new PropertyDefinition('description') |
||
557 | ) |
||
558 | ->addPropertyMap( |
||
559 | new PropertyDefinition('strGender'), |
||
560 | new PropertyDefinition('gender') |
||
561 | ) |
||
562 | ->addPropertyMap( |
||
563 | new PropertyDefinition('strCountry'), |
||
564 | new PropertyDefinition('country') |
||
565 | ) |
||
566 | ->addPropertyMap( |
||
567 | new PropertyDefinition('strTeamBadge'), |
||
568 | new PropertyDefinition('badge') |
||
569 | ) |
||
570 | ->addPropertyMap( |
||
571 | new PropertyDefinition('strTeamJersey'), |
||
572 | new PropertyDefinition('jersey') |
||
573 | ) |
||
574 | ->addPropertyMap( |
||
575 | new PropertyDefinition('strTeamLogo'), |
||
576 | new PropertyDefinition('logo') |
||
577 | ) |
||
578 | ->addPropertyMap( |
||
579 | new PropertyDefinition('strTeamBanner'), |
||
580 | new PropertyDefinition('banner') |
||
581 | ) |
||
582 | ->addPropertyMap( |
||
583 | new PropertyDefinition('strYoutube'), |
||
584 | new PropertyDefinition('youtube') |
||
585 | ) |
||
586 | ->addPropertyMap( |
||
587 | new PropertyDefinition('strLocked'), |
||
588 | new PropertyDefinition('locked') |
||
589 | ); |
||
590 | // idSoccerXML |
||
591 | // intLoved |
||
592 | // strLeague |
||
593 | // strDescriptionDE |
||
594 | // strDescriptionFR |
||
595 | // strDescriptionCN |
||
596 | // strDescriptionIT |
||
597 | // strDescriptionJP |
||
598 | // strDescriptionRU |
||
599 | // strDescriptionES |
||
600 | // strDescriptionPT |
||
601 | // strDescriptionSE |
||
602 | // strDescriptionNL |
||
603 | // strDescriptionHU |
||
604 | // strDescriptionNO |
||
605 | // strDescriptionIL |
||
606 | // strDescriptionPL |
||
607 | // strTeamFanart1 |
||
608 | // strTeamFanart2 |
||
609 | // strTeamFanart3 |
||
610 | // strTeamFanart4 |
||
611 | } |
||
612 | |||
614 |