Code Duplication    Length = 9-9 lines in 2 locations

app/library/Services/MatchService.php 2 locations

@@ 325-333 (lines=9) @@
322
        $skinsamoney = $match->skinsamoney; // + carryover A money if any
323
        $skinsbmoney = $match->skinsbmoney; // + carryover B money if any
324
325
        if($aSkinsWon > 0) {
326
            $moneyperskinA = $skinsamoney / $aSkinsWon;
327
328
            $aSkins = Skin::where('match_id', '=', $matchdata['match'])->where('level_id', '=', 1)->get();
329
            foreach ($aSkins as $askin){
330
                $askin->money = $moneyperskinA;
331
                $askin->save();
332
            }
333
        }
334
335
        if($bSkinsWon > 0) {
336
            $moneyperskinB = $skinsbmoney / $bSkinsWon;
@@ 335-343 (lines=9) @@
332
            }
333
        }
334
335
        if($bSkinsWon > 0) {
336
            $moneyperskinB = $skinsbmoney / $bSkinsWon;
337
338
            $bSkins = Skin::where('match_id', '=', $matchdata['match'])->where('level_id', '=', 2)->get();
339
            foreach ($bSkins as $bskin){
340
                $bskin->money = $moneyperskinB;
341
                $bskin->save();
342
            }
343
        }
344
        //foreach player in pivot table create player and run handicap analysis
345
        foreach($match->players as $matchplayer)
346
        {