Test Failed
Push — master ( 8ff729...bf81a5 )
by Julien
03:11
created
src/models/Tree.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@
 block discarded – undo
218 218
 
219 219
     /**
220 220
      * @param Collection $tree
221
-     * @param $settings
221
+     * @param ChampionshipSettings $settings
222 222
      */
223 223
     public static function generateFights(Collection $tree, $settings, Championship $championship = null)
224 224
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 
128 128
         // Delete previous fight for this championship
129 129
 
130
-        $arrayTreeId = $tree->map(function ($value, $key) {
130
+        $arrayTreeId = $tree->map(function($value, $key) {
131 131
             return $value->id;
132 132
         })->toArray();
133 133
         Fight::destroy($arrayTreeId);
Please login to merge, or discard this patch.
src/TreeGen/TreeGen.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@  discard block
 block discarded – undo
20 20
     public $championship, $settings;
21 21
 
22 22
 
23
+    /**
24
+     * @param \Xoco70\KendoTournaments\Models\ChampionshipSettings $settings
25
+     */
23 26
     public function __construct(Championship $championship, $groupBy, $settings)
24 27
     {
25 28
         $this->championship = $championship;
@@ -257,7 +260,7 @@  discard block
 block discarded – undo
257 260
 
258 261
     /**
259 262
      * @param $userGroups
260
-     * @param $max
263
+     * @param integer $max
261 264
      * @return Collection
262 265
      */
263 266
     private function repart($userGroups, $max)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
             } else if ($this->championship->isDirectEliminationType()) {
71 71
                 $roundRobinGroups = $users->chunk(2)->shuffle();
72
-            }else{
72
+            } else {
73 73
                 $roundRobinGroups = new Collection();
74 74
 
75 75
                 // Not so good, Round Robin has no trees
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     private function getTreeSize($userCount, $groupSize)
224 224
     {
225 225
         $square = collect([1, 2, 4, 8, 16, 32, 64]);
226
-        $squareMultiplied = $square->map(function ($item, $key) use ($groupSize) {
226
+        $squareMultiplied = $square->map(function($item, $key) use ($groupSize) {
227 227
             return $item * $groupSize;
228 228
         });
229 229
 
Please login to merge, or discard this patch.
resources/views/partials/tree/directElimination.blade.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-$directEliminationTree = $championship->tree->map(function ($item, $key) use ($championship) {
3
-    if ($championship->category->isTeam()){
2
+$directEliminationTree = $championship->tree->map(function($item, $key) use ($championship) {
3
+    if ($championship->category->isTeam()) {
4 4
 
5 5
         $user1 = $item->team1 != null ? $item->team1->name : "Bye";
6 6
         $user2 = $item->team2 != null ? $item->team2->name : "Bye";
7
-    }else{
7
+    } else {
8 8
         $user1 = $item->user1 != null ? $item->user1->name : "Bye";
9 9
         $user2 = $item->user2 != null ? $item->user2->name : "Bye";
10 10
     }
Please login to merge, or discard this patch.
src/TreeController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 //            'championships.users'
53 53
             )->first();
54 54
 
55
-        $championship = Championship::with('teams','users','category','settings')->find($championship->id);
55
+        $championship = Championship::with('teams', 'users', 'category', 'settings')->find($championship->id);
56 56
 
57 57
         $settings = ChampionshipSettings::createOrUpdate($request, $championship);
58 58
 
Please login to merge, or discard this patch.
src/models/Championship.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,11 +22,11 @@
 block discarded – undo
22 22
     {
23 23
         parent::boot();
24 24
 
25
-        static::deleting(function ($championship) {
25
+        static::deleting(function($championship) {
26 26
             $championship->competitors()->delete();
27 27
             $championship->settings()->delete();
28 28
         });
29
-        static::restoring(function ($championship) {
29
+        static::restoring(function($championship) {
30 30
             $championship->competitors()->restore();
31 31
             $championship->settings()->restore();
32 32
 
Please login to merge, or discard this patch.
src/models/Category.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         'gradeMax',
34 34
     ];
35 35
 
36
-    public function getAliasString(){
36
+    public function getAliasString() {
37 37
         return $this->alias;
38 38
     }
39 39
 
Please login to merge, or discard this patch.
src/models/Tournament.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,14 +59,14 @@
 block discarded – undo
59 59
     protected static function boot()
60 60
     {
61 61
         parent::boot();
62
-        static::deleting(function ($tournament) {
62
+        static::deleting(function($tournament) {
63 63
             foreach ($tournament->championships as $ct) {
64 64
                 $ct->delete();
65 65
             }
66 66
             $tournament->invites()->delete();
67 67
 
68 68
         });
69
-        static::restoring(function ($tournament) {
69
+        static::restoring(function($tournament) {
70 70
 
71 71
             foreach ($tournament->championships()->withTrashed()->get() as $ct) {
72 72
                 $ct->restore();
Please login to merge, or discard this patch.
src/models/Fight.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
             $round = [];
175 175
             $fighters = self::getActorsToFights($championship, $treeGroup);
176 176
 
177
-            $away = $fighters->splice(sizeof($fighters) / 2);  // 2
177
+            $away = $fighters->splice(sizeof($fighters) / 2); // 2
178 178
 
179 179
             $home = $fighters; // 1
180 180
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
     /**
108 108
      * Save a Fight.
109
-     * @param $tree
109
+     * @param Collection $tree
110 110
      * @param int $numRound
111 111
      */
112 112
     public static function saveFightRound($tree, $numRound = 1)
@@ -166,6 +166,9 @@  discard block
 block discarded – undo
166 166
 //        }
167 167
 //    }
168 168
 
169
+    /**
170
+     * @param Collection $tree
171
+     */
169 172
     public static function saveRoundRobinFights(Championship $championship, $tree)
170 173
     {
171 174
 
Please login to merge, or discard this patch.
database/factories/PreliminaryFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Xoco70\KendoTournaments\Models\Tree;
5 5
 
6
-$factory->define(Tree::class, function (Faker\Generator $faker) {
6
+$factory->define(Tree::class, function(Faker\Generator $faker) {
7 7
 
8 8
     return [
9 9
 //        'name' => $faker->name,
Please login to merge, or discard this patch.