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

PlayOffTeamTreeGen::createByeFighter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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