Completed
Push — master ( 0a3a64...75d382 )
by Julien
02:47
created
resources/views/partials/tree/brackets/fight.blade.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2
-$topOffset = ($numRound == 1 ? 0 : (pow(2, $numRound-1)-1) * 51);
2
+$topOffset = ($numRound == 1 ? 0 : (pow(2, $numRound - 1) - 1) * 51);
3 3
 $top = \App\Bracket::getTopFight($numRound, $numFight) + $topOffset;
4 4
 
5 5
 $left = \App\Bracket::getLeftFight($numRound);
6
-if ($numRound== 3) dump(\App\Bracket::getTopFight($numRound, $numFight),$topOffset);
6
+if ($numRound == 3) dump(\App\Bracket::getTopFight($numRound, $numFight), $topOffset);
7 7
 ?>
8 8
 
9 9
 <div class="match-wrapper" style="top: {{ $top }}px; left: {{$left}}px; width: 150px;">
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,9 @@
 block discarded – undo
3 3
 $top = \App\Bracket::getTopFight($numRound, $numFight) + $topOffset;
4 4
 
5 5
 $left = \App\Bracket::getLeftFight($numRound);
6
-if ($numRound== 3) dump(\App\Bracket::getTopFight($numRound, $numFight),$topOffset);
6
+if ($numRound== 3) {
7
+    dump(\App\Bracket::getTopFight($numRound, $numFight),$topOffset);
8
+}
7 9
 ?>
8 10
 
9 11
 <div class="match-wrapper" style="top: {{ $top }}px; left: {{$left}}px; width: 150px;">
Please login to merge, or discard this patch.
resources/views/partials/tree/brackets/upper_bracket.blade.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2
-$default_top1 =30;
3
-$default_top2 =81;
2
+$default_top1 = 30;
3
+$default_top2 = 81;
4 4
 
5
-$top1 = $default_top1 + ($numGroup-1) * 204;
6
-$top2 = $default_top2 + ($numGroup-1) * 204;
5
+$top1 = $default_top1 + ($numGroup - 1) * 204;
6
+$top2 = $default_top2 + ($numGroup - 1) * 204;
7 7
 
8 8
 $default_left = 189;
9
-$left = $default_left * ($numRound-1);
9
+$left = $default_left * ($numRound - 1);
10 10
 
11 11
 
12 12
 ?>
Please login to merge, or discard this patch.
resources/views/partials/tree/directElimination.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 use Xoco70\KendoTournaments\TreeGen\CreateDirectEliminationTree;
3 3
 // Used to regenerate _lft and _rgt
4
-foreach ($championship->fightersGroups as $group){
4
+foreach ($championship->fightersGroups as $group) {
5 5
     $group->fixTree();
6 6
 }
7 7
 $directEliminationTree = $championship->fightersGroups->groupBy('round');
Please login to merge, or discard this patch.
src/Models/Fighter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     public function getFullNameAttribute()
28 28
     {
29
-        if ($this instanceof Competitor){
29
+        if ($this instanceof Competitor) {
30 30
             return $this->getFullName();
31 31
         }
32 32
         return $this->name;
Please login to merge, or discard this patch.
database/factories/TeamFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 use Xoco70\KendoTournaments\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,
Please login to merge, or discard this patch.
database/migrations/2014_10_12_000010_create_users_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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('firstname');
Please login to merge, or discard this patch.
src/TreeGen/TreeGen.php 4 patches
Doc Comments   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     /**
54 54
      * Get the biggest entity group
55
-     * @param $userGroups
55
+     * @param Collection $userGroups
56 56
      *
57 57
      * @return int
58 58
      */
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
     /**
113 113
      * Repart BYE in the tree,
114
-     * @param $fighterGroups
114
+     * @param Collection $fighterGroups
115 115
      * @param int $max
116 116
      *
117 117
      * @return Collection
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
     }
180 180
 
181 181
     /**
182
-     * @param $area
183
-     * @param $order
184
-     * @param $round
182
+     * @param integer $area
183
+     * @param integer $order
184
+     * @param integer $round
185 185
      * @param $parent
186 186
      * @return FightersGroup
187 187
      */
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 
327 327
     /**
328 328
      * @param Collection $fighters
329
-     * @param $frequency
330
-     * @param $sizeGroupBy
329
+     * @param integer $frequency
330
+     * @param integer $sizeGroupBy
331 331
      * @param $bye
332 332
      * @return Collection
333 333
      */
@@ -350,8 +350,8 @@  discard block
 block discarded – undo
350 350
     /**
351 351
      * @param $frequency
352 352
      * @param $sizeGroupBy
353
-     * @param $count
354
-     * @param $byeCount
353
+     * @param integer $count
354
+     * @param integer $byeCount
355 355
      * @return bool
356 356
      */
357 357
     private function shouldInsertBye($frequency, $sizeGroupBy, $count, $byeCount): bool
@@ -361,7 +361,6 @@  discard block
 block discarded – undo
361 361
 
362 362
 
363 363
     /**
364
-     * @param Championship $championship
365 364
      */
366 365
     protected function destroyPreviousFights()
367 366
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,8 @@
 block discarded – undo
8 8
 use Xoco70\KendoTournaments\Exceptions\TreeGenerationException;
9 9
 use Xoco70\KendoTournaments\Models\Championship;
10 10
 use Xoco70\KendoTournaments\Models\ChampionshipSettings;
11
-use Xoco70\KendoTournaments\Models\DirectEliminationFight;
12 11
 use Xoco70\KendoTournaments\Models\Fight;
13 12
 use Xoco70\KendoTournaments\Models\FightersGroup;
14
-use Xoco70\KendoTournaments\Models\PreliminaryFight;
15 13
 
16 14
 class TreeGen implements TreeGenerable
17 15
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     private function getMaxFightersByEntity($userGroups): int
62 62
     {
63 63
         return $userGroups
64
-            ->sortByDesc(function ($group) {
64
+            ->sortByDesc(function($group) {
65 65
                 return $group->count();
66 66
             })
67 67
             ->first()
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     protected function getTreeSize($fighterCount, $groupSize)
100 100
     {
101 101
         $square = collect([1, 2, 4, 8, 16, 32, 64]);
102
-        $squareMultiplied = $square->map(function ($item) use ($groupSize) {
102
+        $squareMultiplied = $square->map(function($item) use ($groupSize) {
103 103
             return $item * $groupSize;
104 104
         });
105 105
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
             $valueToUpdate = $group->getValueToUpdate(); // This should be OK
412 412
             if ($valueToUpdate != null) {
413 413
                 $fighterToUpdate = $group->getParentFighterToUpdate($keyGroup);
414
-                dump("key:".$keyGroup."-".$fighterToUpdate."=>".$valueToUpdate);
414
+                dump("key:" . $keyGroup . "-" . $fighterToUpdate . "=>" . $valueToUpdate);
415 415
                 $parentFight->$fighterToUpdate = $valueToUpdate;
416 416
                 $parentFight->save();
417 417
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -392,7 +392,9 @@
 block discarded – undo
392 392
     {
393 393
         foreach ($groupsByRound as $keyGroup => $group) {
394 394
             $parentGroup = $group->parent;
395
-            if ($parentGroup == null) break;
395
+            if ($parentGroup == null) {
396
+                break;
397
+            }
396 398
             $parentFight = $parentGroup->fights->get(0);
397 399
 
398 400
             // determine whether c1 or c2 must be updated
Please login to merge, or discard this patch.
src/Models/DirectEliminationFight.php 2 patches
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
     public function __construct(Fight $fight = null)
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@
 block discarded – undo
9 9
 {
10 10
     public function __construct(Fight $fight = null)
11 11
     {
12
-        if ($fight!=null){
13
-            $this->id= $fight->id;
14
-            $this->short_id= $fight->short_id;
15
-            $this->fighters_group_id= $fight->fighters_group_id;
16
-            $this->c1= $fight->c1;
17
-            $this->c2= $fight->c2;
12
+        if ($fight != null) {
13
+            $this->id = $fight->id;
14
+            $this->short_id = $fight->short_id;
15
+            $this->fighters_group_id = $fight->fighters_group_id;
16
+            $this->c1 = $fight->c1;
17
+            $this->c2 = $fight->c2;
18 18
         }
19 19
     }
20 20
     /**
Please login to merge, or discard this patch.
src/Models/PreliminaryFight.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@
 block discarded – undo
9 9
 
10 10
     public function __construct(Fight $fight = null)
11 11
     {
12
-        if ($fight!=null){
13
-            $this->id= $fight->id;
14
-            $this->short_id= $fight->short_id;
15
-            $this->fighters_group_id= $fight->fighters_group_id;
16
-            $this->c1= $fight->c1;
17
-            $this->c2= $fight->c2;
12
+        if ($fight != null) {
13
+            $this->id = $fight->id;
14
+            $this->short_id = $fight->short_id;
15
+            $this->fighters_group_id = $fight->fighters_group_id;
16
+            $this->c1 = $fight->c1;
17
+            $this->c2 = $fight->c2;
18 18
         }
19 19
     }
20 20
 
Please login to merge, or discard this patch.