Code Duplication    Length = 16-17 lines in 2 locations

controllers/MatchController.php 1 location

@@ 72-87 (lines=16) @@
69
        });
70
    }
71
72
    public function editAction(Player $me, Match $match)
73
    {
74
        // TODO: Generating this response is unnecessary
75
        $response = $this->edit($match, $me, "match");
76
77
        if ($this->recalculateNeeded) {
78
            // Redirect to a confirmation form if we are assigning a new leader
79
            $url = Service::getGenerator()->generate('match_recalculate', array(
80
                'match' => $match->getId(),
81
            ));
82
83
            return new RedirectResponse($url);
84
        }
85
86
        return $response;
87
    }
88
89
    public function recalculateAction(Player $me, $match) {
90
        $match = Match::get($match); // get a match even if it's deleted

controllers/TeamController.php 1 location

@@ 37-53 (lines=17) @@
34
        return $this->create($me);
35
    }
36
37
    public function editAction(Player $me, Team $team)
38
    {
39
        // TODO: Generating this response is unnecessary
40
        $response = $this->edit($team, $me, "team");
41
42
        if ($this->newLeader) {
43
            // Redirect to a confirmation form if we are assigning a new leader
44
            $url = Service::getGenerator()->generate('team_assign_leader', array(
45
                'team'   => $team->getAlias(),
46
                'player' => $this->newLeader->getAlias()
47
            ));
48
49
            return new RedirectResponse($url);
50
        }
51
52
        return $response;
53
    }
54
55
    public function deleteAction(Player $me, Team $team)
56
    {