Code Duplication    Length = 13-14 lines in 2 locations

src/TreeGen/DirectEliminationTreeGen.php 1 location

@@ 174-186 (lines=13) @@
171
     * @param integer $numRounds
172
     * @param $numFightersElim
173
     */
174
    protected function pushGroups($numRounds, $numFightersElim)
175
    {
176
        for ($roundNumber = 2; $roundNumber <= $numRounds; $roundNumber++) {
177
            // From last match to first match
178
            $maxMatches = ($numFightersElim / pow(2, $roundNumber));
179
180
            for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) {
181
                $fighters = $this->createByeGroup(2);
182
                $group = $this->saveGroup(1, $matchNumber, $roundNumber, null);
183
                $this->syncGroup($group, $fighters);
184
            }
185
        }
186
    }
187
188
    /**
189
     * Return number of rounds for the tree based on fighter count

src/TreeGen/PlayOffTreeGen.php 1 location

@@ 37-50 (lines=14) @@
34
     * @param integer $numRounds
35
     * @param $numFightersElim
36
     */
37
    protected function pushGroups($numRounds, $numFightersElim)
38
    {
39
        // TODO Here is where you should change when enable several winners for preliminary
40
        for ($roundNumber = 2; $roundNumber <= $numRounds +1; $roundNumber++) {
41
            // From last match to first match
42
            $maxMatches = ($numFightersElim / pow(2, $roundNumber));
43
44
            for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) {
45
                $fighters = $this->createByeGroup(2);
46
                $group = $this->saveGroup(1, $matchNumber, $roundNumber, null);
47
                $this->syncGroup($group, $fighters);
48
            }
49
        }
50
    }
51
    /**
52
     * Create empty groups for direct Elimination Tree
53
     * @param $numFighters