Code Duplication    Length = 16-16 lines in 4 locations

src/Api/BaseStat.php 4 locations

@@ 92-107 (lines=16) @@
89
        $rankDistribution = new StatRankDistribution();
90
        $rankDistribution->date = $distribution['date'];
91
92
        if(array_key_exists('Google', $distribution)){
93
            $rankDistribution->google = new StatEngineRankDistribution([
94
                'one' => $distribution['Google']['One'],
95
                'two' => $distribution['Google']['Two'],
96
                'three' => $distribution['Google']['Three'],
97
                'four' => $distribution['Google']['Four'],
98
                'five' => $distribution['Google']['Five'],
99
                'six_to_ten' => $distribution['Google']['SixToTen'],
100
                'eleven_to_twenty' => $distribution['Google']['ElevenToTwenty'],
101
                'twenty_one_to_thirty' => $distribution['Google']['TwentyOneToThirty'],
102
                'thirty_one_to_forty' => $distribution['Google']['ThirtyOneToForty'],
103
                'forty_one_to_fifty' => $distribution['Google']['FortyOneToFifty'],
104
                'fifty_one_to_hundred' => $distribution['Google']['FiftyOneToHundred'],
105
                'non_ranking' => $distribution['Google']['NonRanking'],
106
            ]);
107
        }
108
109
        if(array_key_exists('GoogleBaseRank', $distribution)){
110
            $rankDistribution->google_base_rank = new StatEngineRankDistribution([
@@ 109-124 (lines=16) @@
106
            ]);
107
        }
108
109
        if(array_key_exists('GoogleBaseRank', $distribution)){
110
            $rankDistribution->google_base_rank = new StatEngineRankDistribution([
111
                'one' => $distribution['GoogleBaseRank']['One'],
112
                'two' => $distribution['GoogleBaseRank']['Two'],
113
                'three' => $distribution['GoogleBaseRank']['Three'],
114
                'four' => $distribution['GoogleBaseRank']['Four'],
115
                'five' => $distribution['GoogleBaseRank']['Five'],
116
                'six_to_ten' => $distribution['GoogleBaseRank']['SixToTen'],
117
                'eleven_to_twenty' => $distribution['GoogleBaseRank']['ElevenToTwenty'],
118
                'twenty_one_to_thirty' => $distribution['GoogleBaseRank']['TwentyOneToThirty'],
119
                'thirty_one_to_forty' => $distribution['GoogleBaseRank']['ThirtyOneToForty'],
120
                'forty_one_to_fifty' => $distribution['GoogleBaseRank']['FortyOneToFifty'],
121
                'fifty_one_to_hundred' => $distribution['GoogleBaseRank']['FiftyOneToHundred'],
122
                'non_ranking' => $distribution['GoogleBaseRank']['NonRanking'],
123
            ]);
124
        }
125
126
        if(array_key_exists('Yahoo', $distribution)){
127
            $rankDistribution->yahoo = new StatEngineRankDistribution([
@@ 126-141 (lines=16) @@
123
            ]);
124
        }
125
126
        if(array_key_exists('Yahoo', $distribution)){
127
            $rankDistribution->yahoo = new StatEngineRankDistribution([
128
                'one' => $distribution['Yahoo']['One'],
129
                'two' => $distribution['Yahoo']['Two'],
130
                'three' => $distribution['Yahoo']['Three'],
131
                'four' => $distribution['Yahoo']['Four'],
132
                'five' => $distribution['Yahoo']['Five'],
133
                'six_to_ten' => $distribution['Yahoo']['SixToTen'],
134
                'eleven_to_twenty' => $distribution['Yahoo']['ElevenToTwenty'],
135
                'twenty_one_to_thirty' => $distribution['Yahoo']['TwentyOneToThirty'],
136
                'thirty_one_to_forty' => $distribution['Yahoo']['ThirtyOneToForty'],
137
                'forty_one_to_fifty' => $distribution['Yahoo']['FortyOneToFifty'],
138
                'fifty_one_to_hundred' => $distribution['Yahoo']['FiftyOneToHundred'],
139
                'non_ranking' => $distribution['Yahoo']['NonRanking'],
140
            ]);
141
        }
142
143
        if(array_key_exists('Bing', $distribution)){
144
            $rankDistribution->bing = new StatEngineRankDistribution([
@@ 143-158 (lines=16) @@
140
            ]);
141
        }
142
143
        if(array_key_exists('Bing', $distribution)){
144
            $rankDistribution->bing = new StatEngineRankDistribution([
145
                'one' => $distribution['Bing']['One'],
146
                'two' => $distribution['Bing']['Two'],
147
                'three' => $distribution['Bing']['Three'],
148
                'four' => $distribution['Bing']['Four'],
149
                'five' => $distribution['Bing']['Five'],
150
                'six_to_ten' => $distribution['Bing']['SixToTen'],
151
                'eleven_to_twenty' => $distribution['Bing']['ElevenToTwenty'],
152
                'twenty_one_to_thirty' => $distribution['Bing']['TwentyOneToThirty'],
153
                'thirty_one_to_forty' => $distribution['Bing']['ThirtyOneToForty'],
154
                'forty_one_to_fifty' => $distribution['Bing']['FortyOneToFifty'],
155
                'fifty_one_to_hundred' => $distribution['Bing']['FiftyOneToHundred'],
156
                'non_ranking' => $distribution['Bing']['NonRanking'],
157
            ]);
158
        }
159
160
        return $rankDistribution;
161
    }