Code Duplication    Length = 9-9 lines in 2 locations

app/library/Services/MatchService.php 2 locations

@@ 312-320 (lines=9) @@
309
        $skinsamoney = $match->skinsamoney; // + carryover A money if any
310
        $skinsbmoney = $match->skinsbmoney; // + carryover B money if any
311
312
        if($aSkinsWon > 0) {
313
            $moneyperskinA = $skinsamoney / $aSkinsWon;
314
315
            $aSkins = Skin::where('match_id', '=', $matchdata['match'])->where('level_id', '=', 1)->get();
316
            foreach ($aSkins as $askin){
317
                $askin->money = $moneyperskinA;
318
                $askin->save();
319
            }
320
        }
321
322
        if($bSkinsWon > 0) {
323
            $moneyperskinB = $skinsbmoney / $bSkinsWon;
@@ 322-330 (lines=9) @@
319
            }
320
        }
321
322
        if($bSkinsWon > 0) {
323
            $moneyperskinB = $skinsbmoney / $bSkinsWon;
324
325
            $bSkins = Skin::where('match_id', '=', $matchdata['match'])->where('level_id', '=', 2)->get();
326
            foreach ($bSkins as $bskin){
327
                $bskin->money = $moneyperskinB;
328
                $bskin->save();
329
            }
330
        }
331
        //foreach player in pivot table create player and run handicap analysis
332
        foreach($match->players as $matchplayer)
333
        {