@@ -111,15 +111,15 @@ |
||
111 | 111 | { |
112 | 112 | $isTeam = $this->group->championship->category->isTeam; |
113 | 113 | if ($isTeam) { |
114 | - $teamToUpdate = 'team'.$numFighter; |
|
114 | + $teamToUpdate = 'team' . $numFighter; |
|
115 | 115 | |
116 | 116 | return optional($this->$teamToUpdate)->$attr; |
117 | 117 | } |
118 | - $competitorToUpdate = 'competitor'.$numFighter; |
|
118 | + $competitorToUpdate = 'competitor' . $numFighter; |
|
119 | 119 | if ($attr == 'name') { |
120 | 120 | return $this->$competitorToUpdate == null |
121 | 121 | ? 'BYE' |
122 | - : $this->$competitorToUpdate->user->firstname.' '.$this->$competitorToUpdate->user->lastname; |
|
122 | + : $this->$competitorToUpdate->user->firstname . ' ' . $this->$competitorToUpdate->user->lastname; |
|
123 | 123 | } elseif ($attr == 'short_id') { |
124 | 124 | return optional($this->$competitorToUpdate)->short_id; |
125 | 125 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->groupsByRound = $groupsByRound; |
27 | 27 | $this->hasPreliminary = $hasPreliminary; |
28 | 28 | |
29 | - $this->firstRoundName = $groupsByRound->first()->map(function ($item) use ($championship) { |
|
29 | + $this->firstRoundName = $groupsByRound->first()->map(function($item) use ($championship) { |
|
30 | 30 | $fighters = $item->getFightersWithBye(); |
31 | 31 | $fighter1 = $fighters->get(0); |
32 | 32 | $fighter2 = $fighters->get(1); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @param $fightersByEntity |
32 | 32 | * |
33 | - * @return mixed |
|
33 | + * @return Collection |
|
34 | 34 | */ |
35 | 35 | protected function chunkAndShuffle(Collection $fightersByEntity) |
36 | 36 | { |
@@ -97,6 +97,9 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | + /** |
|
101 | + * @param integer $round |
|
102 | + */ |
|
100 | 103 | protected function generateGroupsForRound(Collection $fightersByArea, $round) |
101 | 104 | { |
102 | 105 | $fightersId = $fightersByArea->pluck('id'); |
@@ -3,8 +3,6 @@ |
||
3 | 3 | namespace Xoco70\LaravelTournaments\TreeGen; |
4 | 4 | |
5 | 5 | use Illuminate\Support\Collection; |
6 | -use Xoco70\LaravelTournaments\Exceptions\DuplicatedException; |
|
7 | -use Xoco70\LaravelTournaments\Exceptions\DuplicatedFighterException; |
|
8 | 6 | use Xoco70\LaravelTournaments\Models\Competitor; |
9 | 7 | use Xoco70\LaravelTournaments\Models\Fight; |
10 | 8 | use Xoco70\LaravelTournaments\Models\FighterGroupCompetitor; |
@@ -83,8 +83,8 @@ |
||
83 | 83 | protected function updateGroupFighters(FightersGroup $group, Fight $fight, $oldCompetitors) |
84 | 84 | { |
85 | 85 | |
86 | - for ($num = 0; $num <=1;$num++){ |
|
87 | - $c1or2 = "c".($num+1); |
|
86 | + for ($num = 0; $num <= 1; $num++) { |
|
87 | + $c1or2 = "c" . ($num + 1); |
|
88 | 88 | $fgc = FighterGroupCompetitor::where('fighters_group_id', $group->id) |
89 | 89 | ->where('competitor_id', $oldCompetitors[$num]) |
90 | 90 | ->first(); |
@@ -82,8 +82,8 @@ |
||
82 | 82 | protected function updateGroupFighters(FightersGroup $group, Fight $fight, $oldTeams) |
83 | 83 | { |
84 | 84 | |
85 | - for ($num = 0; $num <=1;$num++){ |
|
86 | - $c1or2 = "c".($num+1); |
|
85 | + for ($num = 0; $num <= 1; $num++) { |
|
86 | + $c1or2 = "c" . ($num + 1); |
|
87 | 87 | $fgc = FighterGroupTeam::where('fighters_group_id', $group->id) |
88 | 88 | ->where('team_id', $oldTeams[$num]) |
89 | 89 | ->first(); |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | $prefix = "singleElimination"; |
3 | -if ($championship->hasPreliminary() && $roundNumber ==1){ |
|
3 | +if ($championship->hasPreliminary() && $roundNumber == 1) { |
|
4 | 4 | $prefix = "preliminary"; |
5 | 5 | } |
6 | -$className = $prefix."_select"; |
|
6 | +$className = $prefix . "_select"; |
|
7 | 7 | |
8 | 8 | ?> |
9 | 9 | <!-- r = round, m = match, f = fighter --> |