@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * @param $settings |
|
| 65 | + * @param ChampionshipSettings $settings |
|
| 66 | 66 | * @param Championship $championship |
| 67 | 67 | */ |
| 68 | 68 | public static function generateFights(Collection $rounds, $settings, Championship $championship = null) |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function rounds() |
| 33 | 33 | { |
| 34 | - return $this->belongsToMany(Round::class,'round_team')->withTimestamps(); |
|
| 34 | + return $this->belongsToMany(Round::class, 'round_team')->withTimestamps(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | |
| 77 | 77 | public function rounds() |
| 78 | 78 | { |
| 79 | - return $this->belongsToMany(Round::class,'round_competitor')->withTimestamps(); |
|
| 79 | + return $this->belongsToMany(Round::class, 'round_competitor')->withTimestamps(); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | } |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | -$directEliminationTree = $championship->rounds->map(function ($item, $key) use ($championship) { |
|
| 3 | - if ($championship->category->isTeam()){ |
|
| 2 | +$directEliminationTree = $championship->rounds->map(function($item, $key) use ($championship) { |
|
| 3 | + if ($championship->category->isTeam()) { |
|
| 4 | 4 | |
| 5 | 5 | $fighter1 = $item->team1 != null ? $item->team1->name : "Bye"; |
| 6 | 6 | $fighter2 = $item->team2 != null ? $item->team2->name : "Bye"; |
| 7 | - }else{ |
|
| 7 | + } else { |
|
| 8 | 8 | $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye"; |
| 9 | 9 | $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye"; |
| 10 | 10 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | $fighter1 = $item->team1 != null ? $item->team1->name : "Bye"; |
| 6 | 6 | $fighter2 = $item->team2 != null ? $item->team2->name : "Bye"; |
| 7 | - }else{ |
|
| 7 | + } else{ |
|
| 8 | 8 | $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye"; |
| 9 | 9 | $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye"; |
| 10 | 10 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use \Illuminate\Foundation\Auth\User; |
| 5 | 5 | |
| 6 | -$factory->define(\Illuminate\Foundation\Auth\User::class, function (Faker\Generator $faker) { |
|
| 6 | +$factory->define(\Illuminate\Foundation\Auth\User::class, function(Faker\Generator $faker) { |
|
| 7 | 7 | |
| 8 | 8 | $email = $faker->email; |
| 9 | 9 | return [ |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('users', function (Blueprint $table) { |
|
| 15 | + Schema::create('users', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name'); |
| 18 | 18 | $table->string('email')->unique(); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | namespace Xoco70\KendoTournaments\TreeGen; |
| 5 | 5 | |
| 6 | 6 | use Illuminate\Support\Collection; |
| 7 | -use Illuminate\Support\Facades\Config; |
|
| 8 | 7 | use Xoco70\KendoTournaments\Contracts\TreeGenerable; |
| 9 | 8 | use Xoco70\KendoTournaments\Exceptions\TreeGenerationException; |
| 10 | 9 | use Xoco70\KendoTournaments\Models\Championship; |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
| 245 | - * @param $usersByArea |
|
| 246 | - * @param $area |
|
| 245 | + * @param Collection $usersByArea |
|
| 246 | + * @param integer $area |
|
| 247 | 247 | * @return Collection |
| 248 | 248 | */ |
| 249 | 249 | public function generateAllRounds($usersByArea, $area) |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | /** |
| 278 | 278 | * @param $area |
| 279 | 279 | * @param $fighters |
| 280 | - * @param $order |
|
| 280 | + * @param integer $order |
|
| 281 | 281 | * @return Round |
| 282 | 282 | */ |
| 283 | 283 | public function saveRound($area, $fighters, $order) |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Save a Fight. |
| 89 | - * @param Collection $rounds |
|
| 89 | + * @param \Illuminate\Support\Collection $rounds |
|
| 90 | 90 | * @param int $numRound |
| 91 | 91 | */ |
| 92 | 92 | public static function savePreliminaryFightRound($rounds, $numRound = 1) |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | // } |
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | - * @param Collection $rounds |
|
| 158 | + * @param \Illuminate\Support\Collection $rounds |
|
| 159 | 159 | */ |
| 160 | 160 | public static function saveRoundRobinFights(Championship $championship, $rounds) |
| 161 | 161 | { |
@@ -6,45 +6,45 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CreateTournamentTable extends Migration { |
| 8 | 8 | |
| 9 | - public function up() |
|
| 10 | - { |
|
| 11 | - Schema::create('tournament', function(Blueprint $table) { |
|
| 12 | - $table->increments('id'); |
|
| 9 | + public function up() |
|
| 10 | + { |
|
| 11 | + Schema::create('tournament', function(Blueprint $table) { |
|
| 12 | + $table->increments('id'); |
|
| 13 | 13 | $table->Integer('user_id')->unsigned()->index(); |
| 14 | - $table->foreign('user_id') |
|
| 15 | - ->references('id') |
|
| 16 | - ->on('users') |
|
| 17 | - ->onUpdate('cascade') |
|
| 18 | - ->onDelete('cascade'); |
|
| 19 | - |
|
| 20 | - $table->string('name'); |
|
| 21 | - $table->date('dateIni'); |
|
| 22 | - $table->date('dateFin'); |
|
| 14 | + $table->foreign('user_id') |
|
| 15 | + ->references('id') |
|
| 16 | + ->on('users') |
|
| 17 | + ->onUpdate('cascade') |
|
| 18 | + ->onDelete('cascade'); |
|
| 19 | + |
|
| 20 | + $table->string('name'); |
|
| 21 | + $table->date('dateIni'); |
|
| 22 | + $table->date('dateFin'); |
|
| 23 | 23 | $table->date('registerDateLimit'); |
| 24 | 24 | $table->integer('sport')->unsigned()->default(1); // Default is Kendo for now |
| 25 | - $table->string('promoter')->nullable(); |
|
| 26 | - $table->string('host_organization')->nullable(); |
|
| 27 | - $table->string('technical_assistance')->nullable(); |
|
| 28 | - $table->integer('rule_id')->default(1); |
|
| 25 | + $table->string('promoter')->nullable(); |
|
| 26 | + $table->string('host_organization')->nullable(); |
|
| 27 | + $table->string('technical_assistance')->nullable(); |
|
| 28 | + $table->integer('rule_id')->default(1); |
|
| 29 | 29 | $table->tinyInteger('type')->default(1); // 1= local, 2= state, 3= national, 4=continent, 5=world |
| 30 | 30 | $table->integer("venue_id")->nullable()->unsigned(); |
| 31 | - $table->integer("level_id")->unsigned()->default(1); |
|
| 31 | + $table->integer("level_id")->unsigned()->default(1); |
|
| 32 | 32 | |
| 33 | 33 | $table->foreign('venue_id') |
| 34 | 34 | ->references('id') |
| 35 | 35 | ->on('venue'); |
| 36 | 36 | |
| 37 | - $table->timestamps(); |
|
| 38 | - $table->softDeletes(); |
|
| 39 | - $table->engine = 'InnoDB'; |
|
| 37 | + $table->timestamps(); |
|
| 38 | + $table->softDeletes(); |
|
| 39 | + $table->engine = 'InnoDB'; |
|
| 40 | 40 | |
| 41 | - }); |
|
| 42 | - } |
|
| 41 | + }); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function down() |
|
| 45 | - { |
|
| 46 | - DB::statement('SET FOREIGN_KEY_CHECKS = 0'); |
|
| 47 | - Schema::dropIfExists('tournament'); |
|
| 48 | - DB::statement('SET FOREIGN_KEY_CHECKS = 1'); |
|
| 49 | - } |
|
| 44 | + public function down() |
|
| 45 | + { |
|
| 46 | + DB::statement('SET FOREIGN_KEY_CHECKS = 0'); |
|
| 47 | + Schema::dropIfExists('tournament'); |
|
| 48 | + DB::statement('SET FOREIGN_KEY_CHECKS = 1'); |
|
| 49 | + } |
|
| 50 | 50 | } |
| 51 | 51 | \ No newline at end of file |