Code Duplication    Length = 11-11 lines in 2 locations

models/Team.php 2 locations

@@ 145-155 (lines=11) @@
142
     *
143
     * @return bool|null True if both the player was added to the team AND the team member count was incremented
144
     */
145
    public function addMember($id)
146
    {
147
        $player = Player::get($id);
148
149
        if (!$player->isTeamless()) {
150
            throw new Exception("The player already belongs in a team");
151
        }
152
153
        $player->setTeam($this->getId());
154
        $this->update('members', ++$this->members);
155
    }
156
157
    /**
158
     * Increase or decrease the ELO of the team
@@ 469-479 (lines=11) @@
466
     * @param  int  $id The id of the player to remove
467
     * @return void
468
     */
469
    public function removeMember($id)
470
    {
471
        if (!$this->isMember($id)) {
472
            throw new Exception("The player is not a member of that team");
473
        }
474
475
        $player = Player::get($id);
476
477
        $player->update("team", null);
478
        $this->update('members', --$this->members);
479
    }
480
481
    /**
482
     * Update the description of the team