Conditions | 1 |
Paths | 1 |
Total Lines | 189 |
Code Lines | 139 |
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 |
||
701 | protected static function initPropertyMapDefinition() { |
||
702 | static::$propertyMapDefinition |
||
703 | ->addPropertyMap( |
||
704 | new PropertyDefinition('idEvent'), |
||
705 | new PropertyDefinition('id') |
||
706 | ) |
||
707 | ->addPropertyMap( |
||
708 | new PropertyDefinition('strEvent'), |
||
709 | new PropertyDefinition('name') |
||
710 | ) |
||
711 | ->addPropertyMap( |
||
712 | new PropertyDefinition('strFilename'), |
||
713 | new PropertyDefinition('filename') |
||
714 | ) |
||
715 | ->addPropertyMap( |
||
716 | new PropertyDefinition('idLeague'), |
||
717 | new PropertyDefinition('league', 'league'), |
||
718 | [static::class, 'transformLeague'], |
||
719 | [League::class, 'reverse'] |
||
720 | ) |
||
721 | ->addPropertyMap( |
||
722 | new PropertyDefinition('strSeason'), |
||
723 | new PropertyDefinition('season', 'season'), |
||
724 | [static::class, 'transformSeason'], |
||
725 | [Season::class, 'reverse'] |
||
726 | ) |
||
727 | ->addPropertyMap( |
||
728 | new PropertyDefinition('strDescriptionEN'), |
||
729 | new PropertyDefinition('description') |
||
730 | ) |
||
731 | ->addPropertyMap( |
||
732 | new PropertyDefinition('intHomeScore'), |
||
733 | new PropertyDefinition('homeScore') |
||
734 | ) |
||
735 | ->addPropertyMap( |
||
736 | new PropertyDefinition('intRound'), |
||
737 | new PropertyDefinition('round') |
||
738 | ) |
||
739 | ->addPropertyMap( |
||
740 | new PropertyDefinition('intAwayScore'), |
||
741 | new PropertyDefinition('awayScore') |
||
742 | ) |
||
743 | ->addPropertyMap( |
||
744 | new PropertyDefinition('intSpectators'), |
||
745 | new PropertyDefinition('spectators') |
||
746 | ) |
||
747 | ->addPropertyMap( |
||
748 | new PropertyDefinition('strHomeGoalDetails'), |
||
749 | new PropertyDefinition('homeGoalDetails') |
||
750 | ) |
||
751 | ->addPropertyMap( |
||
752 | new PropertyDefinition('strHomeRedCards'), |
||
753 | new PropertyDefinition('homeRedCards') |
||
754 | ) |
||
755 | ->addPropertyMap( |
||
756 | new PropertyDefinition('strHomeYellowCards'), |
||
757 | new PropertyDefinition('homeYellowCards') |
||
758 | ) |
||
759 | ->addPropertyMap( |
||
760 | new PropertyDefinition('strHomeLineupGoalkeeper'), |
||
761 | new PropertyDefinition('homeLineupGoalkeeper') |
||
762 | ) |
||
763 | ->addPropertyMap( |
||
764 | new PropertyDefinition('strHomeLineupDefense'), |
||
765 | new PropertyDefinition('homeLineupDefense') |
||
766 | ) |
||
767 | ->addPropertyMap( |
||
768 | new PropertyDefinition('strHomeLineupMidfield'), |
||
769 | new PropertyDefinition('homeLineupMidfield') |
||
770 | ) |
||
771 | ->addPropertyMap( |
||
772 | new PropertyDefinition('strHomeLineupForward'), |
||
773 | new PropertyDefinition('homeLineupForward') |
||
774 | ) |
||
775 | ->addPropertyMap( |
||
776 | new PropertyDefinition('strHomeLineupSubstitutes'), |
||
777 | new PropertyDefinition('homeLineupSubstitutes') |
||
778 | ) |
||
779 | ->addPropertyMap( |
||
780 | new PropertyDefinition('strHomeLineupFormation'), |
||
781 | new PropertyDefinition('homeLineupFormation') |
||
782 | ) |
||
783 | ->addPropertyMap( |
||
784 | new PropertyDefinition('intHomeShots'), |
||
785 | new PropertyDefinition('homeShots') |
||
786 | ) |
||
787 | ->addPropertyMap( |
||
788 | new PropertyDefinition('strAwayGoalDetails'), |
||
789 | new PropertyDefinition('awayGoalDetails') |
||
790 | ) |
||
791 | ->addPropertyMap( |
||
792 | new PropertyDefinition('strAwayRedCards'), |
||
793 | new PropertyDefinition('awayRedCards') |
||
794 | ) |
||
795 | ->addPropertyMap( |
||
796 | new PropertyDefinition('strAwayYellowCards'), |
||
797 | new PropertyDefinition('awayYellowCards') |
||
798 | ) |
||
799 | ->addPropertyMap( |
||
800 | new PropertyDefinition('strAwayLineupGoalkeeper'), |
||
801 | new PropertyDefinition('awayLineupGoalkeeper') |
||
802 | ) |
||
803 | ->addPropertyMap( |
||
804 | new PropertyDefinition('strAwayLineupDefense'), |
||
805 | new PropertyDefinition('awayLineupDefense') |
||
806 | ) |
||
807 | ->addPropertyMap( |
||
808 | new PropertyDefinition('strAwayLineupMidfield'), |
||
809 | new PropertyDefinition('awayLineupMidfield') |
||
810 | ) |
||
811 | ->addPropertyMap( |
||
812 | new PropertyDefinition('strAwayLineupForward'), |
||
813 | new PropertyDefinition('awayLineupForward') |
||
814 | ) |
||
815 | ->addPropertyMap( |
||
816 | new PropertyDefinition('strAwayLineupSubstitutes'), |
||
817 | new PropertyDefinition('awayLineupSubstitutes') |
||
818 | ) |
||
819 | ->addPropertyMap( |
||
820 | new PropertyDefinition('strAwayLineupFormation'), |
||
821 | new PropertyDefinition('awayLineupFormation') |
||
822 | ) |
||
823 | ->addPropertyMap( |
||
824 | new PropertyDefinition('intAwayShots'), |
||
825 | new PropertyDefinition('awayShots') |
||
826 | ) |
||
827 | ->addPropertyMap( |
||
828 | new PropertyDefinition('dateEvent'), |
||
829 | new PropertyDefinition('date') |
||
830 | )/* todo: map dateEvent and strTime to date*/ |
||
|
|||
831 | ->addPropertyMap( |
||
832 | new PropertyDefinition('strTVStation'), |
||
833 | new PropertyDefinition('tvStation') |
||
834 | ) |
||
835 | ->addPropertyMap( |
||
836 | new PropertyDefinition('idHomeTeam'), |
||
837 | new PropertyDefinition('homeTeam', 'team'), |
||
838 | [static::class, 'transformHomeTeam'], |
||
839 | [Team::class, 'reverse'] |
||
840 | ) |
||
841 | ->addPropertyMap( |
||
842 | new PropertyDefinition('idAwayTeam'), |
||
843 | new PropertyDefinition('awayTeam', 'team'), |
||
844 | [self::class, 'transformAwayTeam'], |
||
845 | [Team::class, 'reverse'] |
||
846 | ) |
||
847 | ->addPropertyMap( |
||
848 | new PropertyDefinition('strResult'), |
||
849 | new PropertyDefinition('result') |
||
850 | ) |
||
851 | ->addPropertyMap( |
||
852 | new PropertyDefinition('strCircuit'), |
||
853 | new PropertyDefinition('circuit') |
||
854 | ) |
||
855 | ->addPropertyMap( |
||
856 | new PropertyDefinition('strCountry'), |
||
857 | new PropertyDefinition('country') |
||
858 | ) |
||
859 | ->addPropertyMap( |
||
860 | new PropertyDefinition('strCity'), |
||
861 | new PropertyDefinition('city') |
||
862 | ) |
||
863 | ->addPropertyMap( |
||
864 | new PropertyDefinition('strPoster'), |
||
865 | new PropertyDefinition('poster') |
||
866 | ) |
||
867 | ->addPropertyMap( |
||
868 | new PropertyDefinition('strThumb'), |
||
869 | new PropertyDefinition('thumb') |
||
870 | ) |
||
871 | ->addPropertyMap( |
||
872 | new PropertyDefinition('strBanner'), |
||
873 | new PropertyDefinition('banner') |
||
874 | ) |
||
875 | ->addPropertyMap( |
||
876 | new PropertyDefinition('strMap'), |
||
877 | new PropertyDefinition('map') |
||
878 | ) |
||
879 | ->addPropertyMap( |
||
880 | new PropertyDefinition('strLocked'), |
||
881 | new PropertyDefinition('locked') |
||
882 | ); |
||
883 | // idSoccerXML |
||
884 | // strLeague |
||
885 | // strHomeTeam |
||
886 | // strAwayTeam |
||
887 | // strFanart |
||
888 | // strTime |
||
889 | } |
||
890 | |||
892 |