Test Failed
Branch scoresheet (1f7963)
by Julien
08:51 queued 58s
created
src/models/FightersGroup.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 
72 72
         // Delete previous fight for this championship
73 73
 
74
-        $arrGroupsId = $fightersGroup->map(function ($value, $key) {
74
+        $arrGroupsId = $fightersGroup->map(function($value, $key) {
75 75
             return $value->id;
76 76
         })->toArray();
77 77
         Fight::destroy($arrGroupsId);
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
     /**
66 66
      * @param Collection $fightersGroup
67
-     * @param $settings
67
+     * @param ChampionshipSettings $settings
68 68
      */
69 69
     public static function generateFights(Collection $fightersGroup, $settings, Championship $championship = null)
70 70
     {
Please login to merge, or discard this patch.
src/TreeController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,11 +77,11 @@
 block discarded – undo
77 77
             FightersGroup::generateFights($groups, $settings, $championship);
78 78
         } catch (TreeGenerationException $e) {
79 79
             redirect()->back()
80
-                ->withErrors([$numFighters ."-".$e->getMessage()]);
80
+                ->withErrors([$numFighters . "-" . $e->getMessage()]);
81 81
         }
82 82
 
83 83
         return redirect()->back()
84 84
             ->with('numFighters', $numFighters)
85
-            ->with(['success' , "Success"]);
85
+            ->with(['success', "Success"]);
86 86
     }
87 87
 }
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->integer('championship_id')->unsigned()->index();
19 19
             $table->tinyInteger('round')->default(0); // Eliminitory, 1/8, 1/4, etc.
Please login to merge, or discard this patch.
database/migrations/2017_03_15_000437_create_Competitor_Team_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('competitor_team', function (Blueprint $table) {
16
+        Schema::create('competitor_team', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('team_id')->unsigned()->nullable()->index();
19 19
             $table->integer('competitor_id')->unsigned()->index();
Please login to merge, or discard this patch.
src/TreeGen/TreeGen.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Xoco70\KendoTournaments\TreeGen;
4 4
 
5
-use App\User;
6 5
 use Illuminate\Support\Collection;
7 6
 use Xoco70\KendoTournaments\Contracts\TreeGenerable;
8 7
 use Xoco70\KendoTournaments\Exceptions\TreeGenerationException;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     private function getTreeSize($fighterCount, $groupSize)
156 156
     {
157 157
         $square = collect([1, 2, 4, 8, 16, 32, 64]);
158
-        $squareMultiplied = $square->map(function ($item, $key) use ($groupSize) {
158
+        $squareMultiplied = $square->map(function($item, $key) use ($groupSize) {
159 159
             return $item * $groupSize;
160 160
         });
161 161
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             // Chunking to make small round robin groups
265 265
             if ($this->championship->hasPreliminary()) {
266 266
                 $fightersGroup = $fightersByEntity->chunk($this->settings->preliminaryGroupSize)->shuffle();
267
-            } elseif ($this->championship->isDirectEliminationType() || $round>1) {
267
+            } elseif ($this->championship->isDirectEliminationType() || $round > 1) {
268 268
                 $fightersGroup = $fightersByEntity->chunk(2)->shuffle();
269 269
             } else { // Round Robin
270 270
                 $fightersGroup = $fightersByEntity->chunk($fightersByEntity->count());
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -252,8 +252,9 @@  discard block
 block discarded – undo
252 252
     }
253 253
 
254 254
     /**
255
-     * @param $usersByArea
256
-     * @param $area
255
+     * @param Collection $usersByArea
256
+     * @param integer $area
257
+     * @param integer $round
257 258
      *
258 259
      */
259 260
     public function generateGroupsForRound($usersByArea, $area, $round)
@@ -283,7 +284,7 @@  discard block
 block discarded – undo
283 284
     /**
284 285
      * @param $area
285 286
      * @param $fighters
286
-     * @param $order
287
+     * @param integer $order
287 288
      * @param $round
288 289
      * @return FightersGroup
289 290
      */
Please login to merge, or discard this patch.
resources/views/partials/tree/directElimination.blade.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 use Xoco70\KendoTournaments\TreeGen\DirectEliminationTreeGen;
3 3
 
4
-$directEliminationTree = $championship->fightersGroups->where('round',1)->map(function ($item, $key) use ($championship) {
5
-    if ($championship->category->isTeam()){
4
+$directEliminationTree = $championship->fightersGroups->where('round', 1)->map(function($item, $key) use ($championship) {
5
+    if ($championship->category->isTeam()) {
6 6
 
7 7
         $fighter1 = $item->team1 != null ? $item->team1->name : "Bye";
8 8
         $fighter2 = $item->team2 != null ? $item->team2->name : "Bye";
9
-    }else{
9
+    } else {
10 10
         $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye";
11 11
         $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye";
12 12
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
         $fighter1 = $item->team1 != null ? $item->team1->name : "Bye";
8 8
         $fighter2 = $item->team2 != null ? $item->team2->name : "Bye";
9
-    }else{
9
+    } else{
10 10
         $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye";
11 11
         $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye";
12 12
 
Please login to merge, or discard this patch.
src/TreeGen/DirectEliminationTreeGen.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,9 @@
 block discarded – undo
56 56
         $matches = array_chunk($teams, 2);
57 57
 
58 58
         //If there's already a match in the match array, then that means the next round is round 2, so increase the round number
59
-        if (count($this->brackets)) $roundNumber++;
59
+        if (count($this->brackets)) {
60
+            $roundNumber++;
61
+        }
60 62
 
61 63
         $countMatches = count($matches);
62 64
         //Create the first full round of teams, some may be blank if waiting on the results of a previous round
Please login to merge, or discard this patch.
src/models/Fight.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         if ($championship->category->isTeam) {
36 36
             $fighters = $group->teams;
37
-            if (sizeof($fighters) == 0){
37
+            if (sizeof($fighters) == 0) {
38 38
                 $fighters->push(new Team());
39 39
                 $fighters->push(new Team());
40 40
             } else if (count($fighters) % 2 != 0) {
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 
44 44
         } else {
45 45
             $fighters = $group->competitors;
46
-            if (sizeof($fighters) == 0){ // If
46
+            if (sizeof($fighters) == 0) { // If
47 47
                 $fighters->push(new Competitor());
48 48
                 $fighters->push(new Competitor());
49
-            }else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE
49
+            } else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE
50 50
                 $fighters->push(new Competitor());
51 51
             }
52 52
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
             if (sizeof($fighters) == 0){ // If
47 47
                 $fighters->push(new Competitor());
48 48
                 $fighters->push(new Competitor());
49
-            }else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE
49
+            } else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE
50 50
                 $fighters->push(new Competitor());
51 51
             }
52 52
 
Please login to merge, or discard this patch.