@@ -86,15 +86,23 @@ |
||
86 | 86 | |
87 | 87 | public function getName() |
88 | 88 | { |
89 | - if ($this == null) return "BYE"; |
|
90 | - if ($this->user == null) return "BYE"; |
|
89 | + if ($this == null) { |
|
90 | + return "BYE"; |
|
91 | + } |
|
92 | + if ($this->user == null) { |
|
93 | + return "BYE"; |
|
94 | + } |
|
91 | 95 | return $this->user->name; |
92 | 96 | } |
93 | 97 | |
94 | 98 | public function getFullName() |
95 | 99 | { |
96 | - if ($this == null) return "BYE"; |
|
97 | - if ($this->user == null) return "BYE"; |
|
100 | + if ($this == null) { |
|
101 | + return "BYE"; |
|
102 | + } |
|
103 | + if ($this->user == null) { |
|
104 | + return "BYE"; |
|
105 | + } |
|
98 | 106 | return $this->user->firstname . " " . $this->user->lastname; |
99 | 107 | } |
100 | 108 |
@@ -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, 'kendo-tournaments'); |
21 | 21 | |
22 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
23 | - $this->loadTranslationsFrom(__DIR__.'/../translations', 'kendo-tournaments'); |
|
22 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
23 | + $this->loadTranslationsFrom(__DIR__ . '/../translations', 'kendo-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/kendo-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/kendo-tournaments')], 'assets'); |
|
29 | 29 | |
30 | - $router->group(['prefix' => 'kendo-tournaments', 'middleware' => ['web']], function ($router) { |
|
30 | + $router->group(['prefix' => 'kendo-tournaments', 'middleware' => ['web']], function($router) { |
|
31 | 31 | $router->get('/', 'Xoco70\KendoTournaments\TreeController@index')->name('tree.index'); |
32 | 32 | $router->post('/championships/{championship}/trees', 'Xoco70\KendoTournaments\TreeController@store')->name('tree.store'); |
33 | 33 | }); |
@@ -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('short_id')->unsigned()->nullable(); |
19 | 19 | $table->integer('fighters_group_id')->unsigned()->index(); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('category', function (Blueprint $table) { |
|
15 | + Schema::create('category', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name'); |
18 | 18 | $table->string('gender')->nullable(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $table->engine = 'InnoDB'; |
29 | 29 | }); |
30 | 30 | |
31 | - Schema::create('championship', function (Blueprint $table) { |
|
31 | + Schema::create('championship', function(Blueprint $table) { |
|
32 | 32 | $table->increments('id'); |
33 | 33 | $table->integer('tournament_id')->unsigned()->index(); |
34 | 34 | $table->integer('category_id')->unsigned()->index(); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $table->engine = 'InnoDB'; |
51 | 51 | }); |
52 | 52 | |
53 | - Schema::create('competitor', function (Blueprint $table) { |
|
53 | + Schema::create('competitor', function(Blueprint $table) { |
|
54 | 54 | $table->increments('id'); |
55 | 55 | $table->integer('short_id')->unsigned()->nullable(); |
56 | 56 | $table->integer('championship_id')->unsigned()->index(); |
@@ -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->tinyInteger('short_id')->unsigned()->nullable(); |
19 | 19 | $table->integer('championship_id')->unsigned()->index(); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - $settings = $championship->getSettings(); |
|
2 | + $settings = $championship->getSettings(); |
|
3 | 3 | ?> |
4 | 4 | <div align="center"> |
5 | 5 | @if (Request::is('championships/'.$championship->id.'/pdf')) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * @param $userGroups |
|
51 | + * @param Collection $userGroups |
|
52 | 52 | * |
53 | 53 | * @return int |
54 | 54 | */ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
165 | - * @param $fighterGroups |
|
165 | + * @param Collection $fighterGroups |
|
166 | 166 | * @param int $max |
167 | 167 | * |
168 | 168 | * @return Collection |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | |
249 | 249 | /** |
250 | 250 | * @param $fighters |
251 | - * @param $area |
|
251 | + * @param integer $area |
|
252 | 252 | * @param integer $order |
253 | - * @param $round |
|
253 | + * @param integer $round |
|
254 | 254 | * @return FightersGroup |
255 | 255 | */ |
256 | 256 | public function saveGroupAndSync($fighters, $area, $order, $round, $parent, $shuffle) |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | /** |
292 | 292 | * @param $area |
293 | - * @param $order |
|
293 | + * @param integer $order |
|
294 | 294 | * @param $round |
295 | 295 | * @param $parent |
296 | 296 | * @return FightersGroup |
@@ -415,8 +415,8 @@ discard block |
||
415 | 415 | } |
416 | 416 | |
417 | 417 | /** |
418 | - * @param $round |
|
419 | - * @param $shuffle |
|
418 | + * @param integer $round |
|
419 | + * @param integer $shuffle |
|
420 | 420 | * @param $fightersByEntity |
421 | 421 | * @return mixed |
422 | 422 | */ |
@@ -206,7 +206,9 @@ |
||
206 | 206 | foreach ($fightsByRound as $numFight => $fight) { |
207 | 207 | |
208 | 208 | $parentGroup = $fight->group->parent; |
209 | - if ($parentGroup == null) break; |
|
209 | + if ($parentGroup == null) { |
|
210 | + break; |
|
211 | + } |
|
210 | 212 | $parentFight = $parentGroup->fights->get(0); |
211 | 213 | |
212 | 214 | // IN this $fight, if it is the first child or the second child --> c1 or c2 in parent |