Passed
Push — master ( 59b1f2...d98836 )
by Julien
33:15
created

PlayOffCompetitorTreeGen::getFighters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
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\Competitor;
7
use Xoco70\KendoTournaments\Models\FightersGroup;
8
9
class PlayOffCompetitorTreeGen extends PlayOffTreeGen
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->competitors;
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
        return $group->syncCompetitors($fighters);
29
    }
30
31
    protected function createByeFighter()
32
    {
33
        return new Competitor();
34
    }
35
}
36