Code Duplication    Length = 10-10 lines in 2 locations

models/Leaderboard.php 1 location

@@ 180-189 (lines=10) @@
177
178
        $item = new $class;
179
        $i = $min+1;
180
        foreach ($redis->zRevRange($this->key, $min, $max, true) as $id => $score) {
181
            $item->subjectId = $id;
182
183
            $this->items[$i] = [
184
                'id'=>$id,
185
                'name'=>$item->getSubjectName(),
186
                'score'=>$score,
187
                ];
188
            $i++;
189
        }
190
    }
191
192
    public function getRankDescription()

models/ContestList.php 1 location

@@ 198-207 (lines=10) @@
195
196
        $item = new Player;
197
        $i = $min+1;
198
        foreach ($redis->zRevRange('contest:list:'.$this->id.':points', $min, $max, true) as $id => $score) {
199
            $item->subjectId = $id;
200
201
            $this->list[$i] = [
202
                'id'=>$id,
203
                'name'=>$item->getSubjectName(),
204
                'score'=>$score,
205
                ];
206
            $i++;
207
        }
208
    }
209
210
    public function listBestPlayers()