Code Duplication    Length = 16-17 lines in 2 locations

controllers/MatchController.php 1 location

@@ 96-111 (lines=16) @@
93
        });
94
    }
95
96
    public function editAction(Player $me, Match $match)
97
    {
98
        // TODO: Generating this response is unnecessary
99
        $response = $this->edit($match, $me, "match");
100
101
        if ($this->recalculateNeeded && $match->isOfficial()) {
102
            // Redirect to a confirmation form if we are assigning a new leader
103
            $url = Service::getGenerator()->generate('match_recalculate', array(
104
                'match' => $match->getId(),
105
            ));
106
107
            return new RedirectResponse($url);
108
        }
109
110
        return $response;
111
    }
112
113
    public function recalculateAction(Player $me, $match)
114
    {

controllers/TeamController.php 1 location

@@ 62-78 (lines=17) @@
59
        return $this->create($me);
60
    }
61
62
    public function editAction(Player $me, Team $team)
63
    {
64
        // TODO: Generating this response is unnecessary
65
        $response = $this->edit($team, $me, "team");
66
67
        if ($this->newLeader) {
68
            // Redirect to a confirmation form if we are assigning a new leader
69
            $url = Service::getGenerator()->generate('team_assign_leader', array(
70
                'team'   => $team->getAlias(),
71
                'player' => $this->newLeader->getAlias()
72
            ));
73
74
            return new RedirectResponse($url);
75
        }
76
77
        return $response;
78
    }
79
80
    public function deleteAction(Player $me, Team $team)
81
    {