Code Duplication    Length = 8-9 lines in 2 locations

migrations/20150323220315_group_team_events.php 2 locations

@@ 58-65 (lines=8) @@
55
        // No need to rollback the group.join event, team information can stay
56
57
        // Teams can't be kicked from groups
58
        $this->editGroupEvent('group.kick', function (&$data) {
59
            if ($data['kicked']['type'] === 'Player') {
60
                $data['kicked'] = $data['kicked']['id'];
61
            } else {
62
                // Delete events where a team gets kicked
63
                return new Delete();
64
            }
65
        });
66
67
        // Teams can't abandon groups
68
        $this->editGroupEvent('group.abandon', function (&$data) {
@@ 68-76 (lines=9) @@
65
        });
66
67
        // Teams can't abandon groups
68
        $this->editGroupEvent('group.abandon', function (&$data) {
69
            if ($data['member']['type'] === 'Player') {
70
                $data['player'] = $data['member']['id'];
71
                unset($data['member']);
72
            } else {
73
                // Delete events where a team abandons the group
74
                return new Delete();
75
            }
76
        });
77
    }
78
}
79