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

PlayOffTeamTreeGen   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFighters() 0 4 1
A syncGroup() 0 6 1
A createByeFighter() 0 4 1
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