Code Duplication    Length = 9-10 lines in 2 locations

src/TreeGen/SingleEliminationTreeGen.php 1 location

@@ 39-48 (lines=10) @@
36
    protected function pushGroups($numRounds, $numFighters)
37
    {
38
        // TODO Here is where you should change when enable several winners for preliminary
39
        for ($roundNumber = 2; $roundNumber <= $numRounds + 1; $roundNumber++) {
40
            // From last match to first match
41
            $maxMatches = ($numFighters / pow(2, $roundNumber));
42
43
            for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) {
44
                $fighters = $this->createByeGroup(2);
45
                $group = $this->saveGroup($matchNumber, $roundNumber, null);
46
                $this->syncGroup($group, $fighters);
47
            }
48
        }
49
        // Third place Group
50
        if ($numFighters >= $this->championship->getGroupSize() * 2) {
51
            $fighters = $this->createByeGroup(2);

src/TreeGen/PlayOffTreeGen.php 1 location

@@ 61-69 (lines=9) @@
58
     */
59
    protected function pushGroups($numRounds, $numFightersElim)
60
    {
61
        for ($roundNumber = 2; $roundNumber <= $numRounds; $roundNumber++) {
62
            // From last match to first match
63
            $maxMatches = ($numFightersElim / pow(2, $roundNumber));
64
            for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) {
65
                $fighters = $this->createByeGroup(2);
66
                $group = $this->saveGroup($matchNumber, $roundNumber, null);
67
                $this->syncGroup($group, $fighters);
68
            }
69
        }
70
    }
71
72
    /**