Passed
Branch bigRefactor (c260a1)
by Julien
34:53
created

DirectEliminationTeamTreeGen::syncGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Xoco70\KendoTournaments\TreeGen;
4
5
use Illuminate\Support\Collection;
6
use Xoco70\KendoTournaments\Models\FightersGroup;
7
use Xoco70\KendoTournaments\Models\Team;
8
9
class DirectEliminationTeamTreeGen extends TreeGen
10
{
11
    /**
12
     * Fighter is the name for competitor or team, depending on the case
13
     * @return Collection
14
     */
15
    protected function getFighters()
16
    {
17
        return $this->championship->teams;
18
    }
19
20
    /**
21
     * @param $group
22
     * @param $fighters
23
     * @return FightersGroup
24
     */
25
    public function syncGroup($group, $fighters)
26
    {
27
        // Add all competitors to Pivot Table
28
        $group->syncTeams($fighters);
29
        return $group;
30
    }
31
32
    protected function createByeFighter()
33
    {
34
        return new Team();
35
    }
36
}
37