@@ -180,7 +180,7 @@ |
||
| 180 | 180 | public function hasDeterminedParent() |
| 181 | 181 | { |
| 182 | 182 | // There is more than 1 fight, should be Preliminary |
| 183 | - if (sizeof($this->fighters()) > 1){ |
|
| 183 | + if (sizeof($this->fighters()) > 1) { |
|
| 184 | 184 | return false; |
| 185 | 185 | } |
| 186 | 186 | foreach ($this->children as $child) { |
@@ -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); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $prefix = "directElimination"; |
| 3 | -if ($championship->hasPreliminary() && $numRound ==1){ |
|
| 3 | +if ($championship->hasPreliminary() && $numRound == 1) { |
|
| 4 | 4 | $prefix = "preliminary"; |
| 5 | 5 | } |
| 6 | -$className = $prefix."_select"; |
|
| 7 | -$selectName = $prefix."_fighters[]"; |
|
| 6 | +$className = $prefix . "_select"; |
|
| 7 | +$selectName = $prefix . "_fighters[]"; |
|
| 8 | 8 | ?> |
| 9 | 9 | <select name="{{ $selectName }}" class={{$className}}> |
| 10 | 10 | <option {{ $selected == '' ? ' selected' : '' }} ></option> |
@@ -7,12 +7,12 @@ |
||
| 7 | 7 | public function __construct(Fight $fight = null) |
| 8 | 8 | { |
| 9 | 9 | parent::__construct(); |
| 10 | - if ($fight!=null){ |
|
| 11 | - $this->id= $fight->id; |
|
| 12 | - $this->short_id= $fight->short_id; |
|
| 13 | - $this->fighters_group_id= $fight->fighters_group_id; |
|
| 14 | - $this->c1= $fight->c1; |
|
| 15 | - $this->c2= $fight->c2; |
|
| 10 | + if ($fight != null) { |
|
| 11 | + $this->id = $fight->id; |
|
| 12 | + $this->short_id = $fight->short_id; |
|
| 13 | + $this->fighters_group_id = $fight->fighters_group_id; |
|
| 14 | + $this->c1 = $fight->c1; |
|
| 15 | + $this->c2 = $fight->c2; |
|
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 | /** |
@@ -10,12 +10,12 @@ |
||
| 10 | 10 | public function __construct(Fight $fight = null) |
| 11 | 11 | { |
| 12 | 12 | parent::__construct(); |
| 13 | - if ($fight!=null){ |
|
| 14 | - $this->id= $fight->id; |
|
| 15 | - $this->short_id= $fight->short_id; |
|
| 16 | - $this->fighters_group_id= $fight->fighters_group_id; |
|
| 17 | - $this->c1= $fight->c1; |
|
| 18 | - $this->c2= $fight->c2; |
|
| 13 | + if ($fight != null) { |
|
| 14 | + $this->id = $fight->id; |
|
| 15 | + $this->short_id = $fight->short_id; |
|
| 16 | + $this->fighters_group_id = $fight->fighters_group_id; |
|
| 17 | + $this->c1 = $fight->c1; |
|
| 18 | + $this->c2 = $fight->c2; |
|
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('tournament', function (Blueprint $table) { |
|
| 11 | + Schema::create('tournament', function(Blueprint $table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | //TODO Added ->nullable() to solve FK issue with Sqlite :( |
| 14 | 14 | $table->Integer('user_id')->unsigned()->nullable()->index(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | private function getMaxFightersByEntity($userGroups): int |
| 80 | 80 | { |
| 81 | 81 | return $userGroups |
| 82 | - ->sortByDesc(function ($group) { |
|
| 82 | + ->sortByDesc(function($group) { |
|
| 83 | 83 | return $group->count(); |
| 84 | 84 | }) |
| 85 | 85 | ->first() |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | protected function getTreeSize($fighterCount, $groupSize) |
| 118 | 118 | { |
| 119 | 119 | $squareMultiplied = collect([1, 2, 4, 8, 16, 32, 64]) |
| 120 | - ->map(function ($item) use ($groupSize) { |
|
| 120 | + ->map(function($item) use ($groupSize) { |
|
| 121 | 121 | return $item * $groupSize; |
| 122 | 122 | }); // [4, 8, 16, 32, 64,...] |
| 123 | 123 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | throw new TreeGenerationException(trans('msg.min_competitor_required', ['number' => config('laravel-tournaments.MIN_COMPETITORS_X_AREA')])); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - if ($this->settings->hasPreliminary && $fighters->count() / ($this->settings->preliminaryGroupSize * $areas) < 1 ) { |
|
| 305 | + if ($this->settings->hasPreliminary && $fighters->count() / ($this->settings->preliminaryGroupSize * $areas) < 1) { |
|
| 306 | 306 | throw new TreeGenerationException(trans('msg.min_competitor_required', ['number' => config('laravel-tournaments.MIN_COMPETITORS_X_AREA')])); |
| 307 | 307 | } |
| 308 | 308 | |
@@ -16,18 +16,18 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function boot(Router $router) |
| 18 | 18 | { |
| 19 | - $viewPath = __DIR__.'/../resources/views'; |
|
| 19 | + $viewPath = __DIR__ . '/../resources/views'; |
|
| 20 | 20 | $this->loadViewsFrom($viewPath, 'laravel-tournaments'); |
| 21 | 21 | |
| 22 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
| 23 | - $this->loadTranslationsFrom(__DIR__.'/../translations', 'laravel-tournaments'); |
|
| 22 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
| 23 | + $this->loadTranslationsFrom(__DIR__ . '/../translations', 'laravel-tournaments'); |
|
| 24 | 24 | |
| 25 | - $this->publishes([__DIR__.'/../database/migrations' => $this->app->databasePath().'/migrations'], 'migrations'); |
|
| 26 | - $this->publishes([__DIR__.'/../database/seeds' => $this->app->databasePath().'/seeds'], 'seeds'); |
|
| 27 | - $this->publishes([__DIR__.'/../database/factories' => $this->app->databasePath().'/factories'], 'seeds'); |
|
| 28 | - $this->publishes([__DIR__.'/../resources/assets' => public_path('vendor/laravel-tournaments')], 'assets'); |
|
| 25 | + $this->publishes([__DIR__ . '/../database/migrations' => $this->app->databasePath() . '/migrations'], 'migrations'); |
|
| 26 | + $this->publishes([__DIR__ . '/../database/seeds' => $this->app->databasePath() . '/seeds'], 'seeds'); |
|
| 27 | + $this->publishes([__DIR__ . '/../database/factories' => $this->app->databasePath() . '/factories'], 'seeds'); |
|
| 28 | + $this->publishes([__DIR__ . '/../resources/assets' => public_path('vendor/laravel-tournaments')], 'assets'); |
|
| 29 | 29 | |
| 30 | - $router->group(['prefix' => 'laravel-tournaments', 'middleware' => ['web']], function ($router) { |
|
| 30 | + $router->group(['prefix' => 'laravel-tournaments', 'middleware' => ['web']], function($router) { |
|
| 31 | 31 | $router->get('/', 'Xoco70\LaravelTournaments\TreeController@index')->name('tree.index'); |
| 32 | 32 | $router->post('/championships/{championship}/trees', 'Xoco70\LaravelTournaments\TreeController@store')->name('tree.store'); |
| 33 | 33 | $router->put('/championships/{championship}/trees', 'Xoco70\LaravelTournaments\TreeController@update')->name('tree.update'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | use Xoco70\LaravelTournaments\Models\Team; |
| 4 | -$factory->define(Team::class, function (Faker\Generator $faker) { |
|
| 4 | +$factory->define(Team::class, function(Faker\Generator $faker) { |
|
| 5 | 5 | |
| 6 | 6 | return [ |
| 7 | 7 | 'name' => $faker->name, |