@@ -22,8 +22,14 @@ discard block |
||
22 | 22 | abstract protected function generateFights(); |
23 | 23 | |
24 | 24 | |
25 | + /** |
|
26 | + * @param string|null $fighterToUpdate |
|
27 | + */ |
|
25 | 28 | abstract protected function addFighterToGroup(FightersGroup $group, $fighter, $fighterToUpdate); |
26 | 29 | |
30 | + /** |
|
31 | + * @return Collection |
|
32 | + */ |
|
27 | 33 | abstract protected function getByeGroup($fighters); |
28 | 34 | |
29 | 35 | abstract protected function getNumRounds($fightersCount); |
@@ -61,7 +67,7 @@ discard block |
||
61 | 67 | /** |
62 | 68 | * Get the biggest entity group. |
63 | 69 | * |
64 | - * @param $userGroups |
|
70 | + * @param Collection $userGroups |
|
65 | 71 | * |
66 | 72 | * @return int |
67 | 73 | */ |
@@ -130,7 +136,7 @@ discard block |
||
130 | 136 | /** |
131 | 137 | * Repart BYE in the tree,. |
132 | 138 | * |
133 | - * @param $fighterGroups |
|
139 | + * @param Collection $fighterGroups |
|
134 | 140 | * @param int $max |
135 | 141 | * |
136 | 142 | * @return Collection |
@@ -288,7 +294,7 @@ discard block |
||
288 | 294 | /** |
289 | 295 | * Attach a parent to every child for nestedSet Navigation. |
290 | 296 | * |
291 | - * @param $numFightersElim |
|
297 | + * @param integer $numFightersElim |
|
292 | 298 | */ |
293 | 299 | protected function addParentToChildren($numFightersElim) |
294 | 300 | { |
@@ -312,8 +318,8 @@ discard block |
||
312 | 318 | |
313 | 319 | /** |
314 | 320 | * @param Collection $fighters |
315 | - * @param $frequency |
|
316 | - * @param $sizeGroupBy |
|
321 | + * @param integer $frequency |
|
322 | + * @param integer $sizeGroupBy |
|
317 | 323 | * @param $bye |
318 | 324 | * |
319 | 325 | * @return Collection |
@@ -338,8 +344,8 @@ discard block |
||
338 | 344 | /** |
339 | 345 | * @param $frequency |
340 | 346 | * @param $sizeGroupBy |
341 | - * @param $count |
|
342 | - * @param $byeCount |
|
347 | + * @param integer $count |
|
348 | + * @param integer $byeCount |
|
343 | 349 | * |
344 | 350 | * @return bool |
345 | 351 | */ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | private function getMaxFightersByEntity($userGroups): int |
69 | 69 | { |
70 | 70 | return $userGroups |
71 | - ->sortByDesc(function ($group) { |
|
71 | + ->sortByDesc(function($group) { |
|
72 | 72 | return $group->count(); |
73 | 73 | }) |
74 | 74 | ->first() |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | protected function getTreeSize($fighterCount, $groupSize) |
108 | 108 | { |
109 | 109 | $squareMultiplied = collect([1, 2, 4, 8, 16, 32, 64]) |
110 | - ->map(function ($item) use ($groupSize) { |
|
110 | + ->map(function($item) use ($groupSize) { |
|
111 | 111 | return $item * $groupSize; |
112 | 112 | }); // [4, 8, 16, 32, 64,...] |
113 | 113 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $sizeGroupBy = count($byeGroup); |
166 | 166 | |
167 | 167 | $frequency = $sizeGroupBy != 0 |
168 | - ? (int) floor($sizeFighters / $sizeGroupBy) |
|
168 | + ? (int)floor($sizeFighters / $sizeGroupBy) |
|
169 | 169 | : -1; |
170 | 170 | |
171 | 171 | // Create Copy of $competitors |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | { |
356 | 356 | // Delete previous fight for this championship |
357 | 357 | $arrGroupsId = $this->championship->fightersGroups()->get()->pluck('id'); |
358 | - if (sizeof($arrGroupsId) > 0){ |
|
358 | + if (sizeof($arrGroupsId) > 0) { |
|
359 | 359 | Fight::destroy($arrGroupsId); |
360 | 360 | } |
361 | 361 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param $fightersByEntity |
31 | 31 | * |
32 | - * @return mixed |
|
32 | + * @return Collection |
|
33 | 33 | */ |
34 | 34 | protected function chunkAndShuffle(Collection $fightersByEntity) |
35 | 35 | { |
@@ -104,6 +104,9 @@ discard block |
||
104 | 104 | $this->generateGroupsForRound($fighters, 1); |
105 | 105 | } |
106 | 106 | |
107 | + /** |
|
108 | + * @param integer $round |
|
109 | + */ |
|
107 | 110 | protected function generateGroupsForRound(Collection $fightersByArea, $round) |
108 | 111 | { |
109 | 112 | $fightersId = $fightersByArea->pluck('id'); |