Completed
Push — master ( f65102...332511 )
by Julien
02:46
created
database/migrations/2016_11_23_125509_create_Fight_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
database/migrations/2015_12_03_230346_create_Category_table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
database/migrations/2016_10_24_223706_create_FightersGroup_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
database/seeds/CompetitorSeeder.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-use Faker\Factory as Faker;
4 3
 use Illuminate\Database\Seeder;
5 4
 use Illuminate\Foundation\Auth\User;
6 5
 use Xoco70\KendoTournaments\Models\Championship;
Please login to merge, or discard this patch.
src/TreeController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
             );
64 64
         }
65 65
 
66
-        $championship->settings =  ChampionshipSettings::createOrUpdate($request, $championship);
66
+        $championship->settings = ChampionshipSettings::createOrUpdate($request, $championship);
67 67
         $generation = $championship->chooseGenerationStrategy();
68 68
 
69 69
         try {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,6 @@
 block discarded – undo
10 10
 use Xoco70\KendoTournaments\Models\Championship;
11 11
 use Xoco70\KendoTournaments\Models\ChampionshipSettings;
12 12
 use Xoco70\KendoTournaments\Models\Competitor;
13
-use Xoco70\KendoTournaments\Models\Fight;
14
-use Xoco70\KendoTournaments\Models\FightersGroup;
15 13
 use Xoco70\KendoTournaments\Models\Tournament;
16 14
 
17 15
 class TreeController extends Controller
Please login to merge, or discard this patch.
src/TreeGen/TreeGen.php 2 patches
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     /**
50 50
      * Get the biggest entity group
51
-     * @param $userGroups
51
+     * @param Collection $userGroups
52 52
      *
53 53
      * @return int
54 54
      */
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
     /**
109 109
      * Repart BYE in the tree,
110
-     * @param $fighterGroups
110
+     * @param Collection $fighterGroups
111 111
      * @param int $max
112 112
      *
113 113
      * @return Collection
@@ -175,9 +175,9 @@  discard block
 block discarded – undo
175 175
     }
176 176
 
177 177
     /**
178
-     * @param $area
179
-     * @param $order
180
-     * @param $round
178
+     * @param integer $area
179
+     * @param integer $order
180
+     * @param integer $round
181 181
      * @param $parent
182 182
      * @return FightersGroup
183 183
      */
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 
339 339
     /**
340 340
      * @param Collection $fighters
341
-     * @param $frequency
342
-     * @param $sizeGroupBy
341
+     * @param integer $frequency
342
+     * @param integer $sizeGroupBy
343 343
      * @param $bye
344 344
      * @return Collection
345 345
      */
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
     /**
363 363
      * @param $frequency
364 364
      * @param $sizeGroupBy
365
-     * @param $count
366
-     * @param $byeCount
365
+     * @param integer $count
366
+     * @param integer $byeCount
367 367
      * @return bool
368 368
      */
369 369
     private function shouldInsertBye($frequency, $sizeGroupBy, $count, $byeCount): bool
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     private function getMaxFightersByEntity($userGroups): int
56 56
     {
57 57
         return $userGroups
58
-            ->sortByDesc(function ($group) {
58
+            ->sortByDesc(function($group) {
59 59
                 return $group->count();
60 60
             })
61 61
             ->first()
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     protected function getTreeSize($fighterCount, $groupSize)
94 94
     {
95 95
         $square = collect([1, 2, 4, 8, 16, 32, 64]);
96
-        $squareMultiplied = $square->map(function ($item) use ($groupSize) {
96
+        $squareMultiplied = $square->map(function($item) use ($groupSize) {
97 97
             return $item * $groupSize;
98 98
         });
99 99
 
Please login to merge, or discard this patch.
src/Models/DirectEliminationFight.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Xoco70\KendoTournaments\Models;
4 4
 
5
-use Illuminate\Database\Eloquent\Model;
6
-use Illuminate\Support\Collection;
7
-
8 5
 class DirectEliminationFight extends Fight
9 6
 {
10 7
 
Please login to merge, or discard this patch.
src/TreeGen/DirectEliminationTreeGen.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Illuminate\Support\Facades\App;
7 7
 use Xoco70\KendoTournaments\Models\Championship;
8 8
 use Xoco70\KendoTournaments\Models\DirectEliminationFight;
9
-use Xoco70\KendoTournaments\Models\Fight;
10 9
 
11 10
 class DirectEliminationTreeGen extends TreeGen
12 11
 {
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,9 @@  discard block
 block discarded – undo
86 86
     {
87 87
         foreach ($fightsByRound as $fight) {
88 88
             $parentGroup = $fight->group->parent;
89
-            if ($parentGroup == null) break;
89
+            if ($parentGroup == null) {
90
+                break;
91
+            }
90 92
             $parentFight = $parentGroup->fights->get(0); //TODO This Might change when extending to Preliminary
91 93
 
92 94
             // IN this $fight, is c1 or c2 has the info?
@@ -160,10 +162,14 @@  discard block
 block discarded – undo
160 162
      */
161 163
     public function hasDeterminedParent()
162 164
     {
163
-        if ($this->group->has2Fighters()) return true;
165
+        if ($this->group->has2Fighters()) {
166
+            return true;
167
+        }
164 168
         foreach ($this->group->children as $child) {
165 169
             $fight = $child->fights->get(0);
166
-            if ($fight->has2Fighters()) return false;
170
+            if ($fight->has2Fighters()) {
171
+                return false;
172
+            }
167 173
         }
168 174
         return true;
169 175
     }
Please login to merge, or discard this patch.
src/TreeGen/PlayOffTreeGen.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use Illuminate\Support\Collection;
6 6
 use Illuminate\Support\Facades\App;
7 7
 use Xoco70\KendoTournaments\Models\Championship;
8
-use Xoco70\KendoTournaments\Models\Fight;
9 8
 use Xoco70\KendoTournaments\Models\PreliminaryFight;
10 9
 
11 10
 class PlayOffTreeGen extends TreeGen
Please login to merge, or discard this patch.