@@ -63,7 +63,7 @@ |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * @param $settings |
|
| 66 | + * @param ChampionshipSettings $settings |
|
| 67 | 67 | * @param Championship $championship |
| 68 | 68 | */ |
| 69 | 69 | public static function generateFights(Collection $fightersGroup, $settings, Championship $championship = null) |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | // Delete previous fight for this championship |
| 73 | 73 | |
| 74 | - $arrGroupsId = $fightersGroup->map(function ($value, $key) { |
|
| 74 | + $arrGroupsId = $fightersGroup->map(function($value, $key) { |
|
| 75 | 75 | return $value->id; |
| 76 | 76 | })->toArray(); |
| 77 | 77 | Fight::destroy($arrGroupsId); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | - * @param $usersByArea |
|
| 250 | - * @param $area |
|
| 249 | + * @param Collection $usersByArea |
|
| 250 | + * @param integer $area |
|
| 251 | 251 | * |
| 252 | 252 | * @return Collection |
| 253 | 253 | */ |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | /** |
| 282 | 282 | * @param $area |
| 283 | 283 | * @param $fighters |
| 284 | - * @param $order |
|
| 284 | + * @param integer $order |
|
| 285 | 285 | * |
| 286 | 286 | * @return FightersGroup |
| 287 | 287 | */ |
@@ -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('area'); |
@@ -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 | } |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Xoco70\KendoTournaments\TreeGen\DirectEliminationTreeGen; |
| 3 | 3 | |
| 4 | -$directEliminationTree = $championship->fightersGroup->map(function ($item, $key) use ($championship) { |
|
| 5 | - if ($championship->category->isTeam()){ |
|
| 4 | +$directEliminationTree = $championship->fightersGroup->map(function($item, $key) use ($championship) { |
|
| 5 | + if ($championship->category->isTeam()) { |
|
| 6 | 6 | |
| 7 | 7 | $fighter1 = $item->team1 != null ? $item->team1->name : "Bye"; |
| 8 | 8 | $fighter2 = $item->team2 != null ? $item->team2->name : "Bye"; |
| 9 | - }else{ |
|
| 9 | + } else { |
|
| 10 | 10 | $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye"; |
| 11 | 11 | $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye"; |
| 12 | 12 | } |