Completed
Push — master ( 332511...198978 )
by Julien
02:42
created
src/TreeController.php 1 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\Team;
16 14
 use Xoco70\KendoTournaments\Models\Tournament;
17 15
 
Please login to merge, or discard this patch.
src/TreeGen/CreateDirectEliminationTree.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     }
234 234
 
235 235
     /**
236
-     * @param $roundNumber
236
+     * @param integer $roundNumber
237 237
      */
238 238
     private function assignFightersToBracket($roundNumber)
239 239
     {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     /**
259 259
      * @param $selected
260 260
      * @param $fighter
261
-     * @param $html
261
+     * @param string $html
262 262
      * @return string
263 263
      */
264 264
     private function addOptionToSelect($selected, $fighter, $html): string
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $this->championship = $championship;
25 25
         $this->names = $names;
26 26
 
27
-        $this->firstRoundName = $names->first()->map(function ($item) use ($championship) {
27
+        $this->firstRoundName = $names->first()->map(function($item) use ($championship) {
28 28
             $fighters = $item->getFighters();
29 29
             $fighter1 = $fighters->get(0);
30 30
             $fighter2 = $fighters->get(1);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         for ($roundNumber = 1; $roundNumber <= $this->noRounds; $roundNumber++) {
241 241
             $groupsByRound = $this->names->get($roundNumber);
242 242
             for ($matchNumber = 1; $matchNumber <= ($this->noTeams / pow(2, $roundNumber)); $matchNumber++) {
243
-                $fight = $groupsByRound[$matchNumber-1]->fights[0];
243
+                $fight = $groupsByRound[$matchNumber - 1]->fights[0];
244 244
 
245 245
                 if ($this->championship->category->isTeam()) {
246 246
                     $fighter1 = $fight->team1;
Please login to merge, or discard this patch.
src/TreeGen/PlayOffTreeGen.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 
15 15
     /**
16 16
      * Calculate the Byes need to fill the Championship Tree.
17
-     * @param Championship $championship
18 17
      * @param $fighters
19 18
      * @return Collection
20 19
      */
Please login to merge, or discard this patch.
src/TreeGen/DirectEliminationTreeGen.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@
 block discarded – undo
68 68
      */
69 69
     public function generateNextRoundsFights()
70 70
     {
71
-        if ($this->championship->category->isTeam){
71
+        if ($this->championship->category->isTeam) {
72 72
             $championship = $this->championship->withCount('teams', 'competitors')->find(2);
73
-        }else{
73
+        } else {
74 74
             $championship = $this->championship->withCount('teams', 'competitors')->first();
75 75
         }
76 76
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     {
71 71
         if ($this->championship->category->isTeam){
72 72
             $championship = $this->championship->withCount('teams', 'competitors')->find(2);
73
-        }else{
73
+        } else{
74 74
             $championship = $this->championship->withCount('teams', 'competitors')->first();
75 75
         }
76 76
 
@@ -90,7 +90,9 @@  discard block
 block discarded – undo
90 90
     {
91 91
         foreach ($fightsByRound as $fight) {
92 92
             $parentGroup = $fight->group->parent;
93
-            if ($parentGroup == null) break;
93
+            if ($parentGroup == null) {
94
+                break;
95
+            }
94 96
             $parentFight = $parentGroup->fights->get(0); //TODO This Might change when extending to Preliminary
95 97
 
96 98
             // IN this $fight, is c1 or c2 has the info?
@@ -164,10 +166,14 @@  discard block
 block discarded – undo
164 166
      */
165 167
     public function hasDeterminedParent()
166 168
     {
167
-        if ($this->group->has2Fighters()) return true;
169
+        if ($this->group->has2Fighters()) {
170
+            return true;
171
+        }
168 172
         foreach ($this->group->children as $child) {
169 173
             $fight = $child->fights->get(0);
170
-            if ($fight->has2Fighters()) return false;
174
+            if ($fight->has2Fighters()) {
175
+                return false;
176
+            }
171 177
         }
172 178
         return true;
173 179
     }
Please login to merge, or discard this patch.
src/models/ChampionshipSettings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public static function createOrUpdate(Request $request, Championship $championship): ChampionshipSettings
64 64
     {
65 65
         $request->request->add(['championship_id' => $championship->id]);
66
-        $arrSettings = $request->except('_token', 'numFighters','isTeam');
66
+        $arrSettings = $request->except('_token', 'numFighters', 'isTeam');
67 67
         $settings = static::where(['championship_id' => $championship->id])->first();
68 68
         if ($settings == null) {
69 69
             $settings = new self();
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
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Xoco70\KendoTournaments\Models\Championship;
5 5
 use Xoco70\KendoTournaments\Models\Team;
6 6
 
7
-$factory->define(Team::class, function (Faker\Generator $faker) {
7
+$factory->define(Team::class, function(Faker\Generator $faker) {
8 8
     return [
9 9
         'name' => $faker->name,
10 10
         'championship_id' => Championship::find(2),
Please login to merge, or discard this patch.
resources/views/tree/index.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 $fightingAreas = $setting->fightingAreas;
22 22
 $fights = $championship->fights;
23 23
 $numFighters = $numFighters ??  5;
24
-$isTeam = $isTeam ??  0;;
24
+$isTeam = $isTeam ??  0; ;
25 25
 ?>
26 26
 @include('kendo-tournaments::partials.errors')
27 27
 
Please login to merge, or discard this patch.