@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fighters_group_team', function (Blueprint $table) { |
|
16 | + Schema::create('fighters_group_team', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('team_id')->unsigned()->nullable()->index(); |
19 | 19 | $table->integer('fighters_group_id')->unsigned()->index(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fight', function (Blueprint $table) { |
|
16 | + Schema::create('fight', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('fighters_group_id')->unsigned()->index(); |
19 | 19 | $table->foreign('fighters_group_id') |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fighters_group_competitor', function (Blueprint $table) { |
|
16 | + Schema::create('fighters_group_competitor', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('competitor_id')->unsigned()->nullable()->index(); |
19 | 19 | $table->integer('fighters_group_id')->unsigned()->index(); |
@@ -77,11 +77,11 @@ |
||
77 | 77 | FightersGroup::generateFights($groups, $settings, $championship); |
78 | 78 | } catch (TreeGenerationException $e) { |
79 | 79 | redirect()->back() |
80 | - ->withErrors([$numFighters ."-".$e->getMessage()]); |
|
80 | + ->withErrors([$numFighters . "-" . $e->getMessage()]); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | return redirect()->back() |
84 | 84 | ->with('numFighters', $numFighters) |
85 | - ->with(['success' , "Success"]); |
|
85 | + ->with(['success', "Success"]); |
|
86 | 86 | } |
87 | 87 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('fighters_groups', function (Blueprint $table) { |
|
16 | + Schema::create('fighters_groups', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('championship_id')->unsigned()->index(); |
19 | 19 | $table->tinyInteger('round')->default(0); // Eliminitory, 1/8, 1/4, etc. |
@@ -254,8 +254,9 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
257 | - * @param $usersByArea |
|
258 | - * @param $area |
|
257 | + * @param Collection $usersByArea |
|
258 | + * @param integer $area |
|
259 | + * @param integer $round |
|
259 | 260 | * |
260 | 261 | * @return Collection |
261 | 262 | */ |
@@ -289,7 +290,7 @@ discard block |
||
289 | 290 | /** |
290 | 291 | * @param $area |
291 | 292 | * @param $fighters |
292 | - * @param $order |
|
293 | + * @param integer $order |
|
293 | 294 | * @param $round |
294 | 295 | * @return FightersGroup |
295 | 296 | */ |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $round = 1; |
56 | 56 | $winnersPerGroup = $this->settings->preliminaryWinner; |
57 | 57 | // loop on areas |
58 | - $tree = $this->generateGroupsForFirstRound($usersByArea, $area, $round ); |
|
58 | + $tree = $this->generateGroupsForFirstRound($usersByArea, $area, $round); |
|
59 | 59 | $round++; |
60 | 60 | |
61 | 61 | $numGroups = sizeof($tree); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | private function getTreeSize($fighterCount, $groupSize) |
158 | 158 | { |
159 | 159 | $square = collect([1, 2, 4, 8, 16, 32, 64]); |
160 | - $squareMultiplied = $square->map(function ($item, $key) use ($groupSize) { |
|
160 | + $squareMultiplied = $square->map(function($item, $key) use ($groupSize) { |
|
161 | 161 | return $item * $groupSize; |
162 | 162 | }); |
163 | 163 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | * @param $round |
294 | 294 | * @return FightersGroup |
295 | 295 | */ |
296 | - public function saveGroup($area, $fighters, $order,$round) |
|
296 | + public function saveGroup($area, $fighters, $order, $round) |
|
297 | 297 | { |
298 | 298 | $fighters = $fighters->pluck('id')->shuffle(); |
299 | 299 |