Completed
Push — master ( 47ea5c...7bab12 )
by Julien
03:03
created
src/TreeGen/CreateDirectEliminationTree.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     }
193 193
 
194 194
     /**
195
-     * @param $numRound
195
+     * @param integer $numRound
196 196
      */
197 197
     private function assignFightersToBracket($numRound, $hasPreliminary)
198 198
     {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     /**
219 219
      * @param $selected
220 220
      * @param $fighter
221
-     * @param $html
221
+     * @param string $html
222 222
      * @return string
223 223
      */
224 224
     private function addOptionToSelect($selected, $fighter, $html): string
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         $this->groupsByRound = $groupsByRound;
27 27
         $this->hasPreliminary = $hasPreliminary;
28 28
 
29
-        $this->firstRoundName = $groupsByRound->first()->map(function ($item) use ($championship) {
29
+        $this->firstRoundName = $groupsByRound->first()->map(function($item) use ($championship) {
30 30
             $fighters = $item->getFightersWithBye();
31 31
             $fighter1 = $fighters->get(0);
32 32
             $fighter2 = $fighters->get(1);
Please login to merge, or discard this patch.
src/models/Fight.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,9 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected static function getFightersWithByes(FightersGroup $group)
46 46
     {
47
-        if ($group == null) return null;
47
+        if ($group == null) {
48
+            return null;
49
+        }
48 50
         $fighters = $group->getFightersWithBye();
49 51
         $fighterType = $group->getFighterType();
50 52
         if (sizeof($fighters) == 0) {
@@ -127,8 +129,12 @@  discard block
 block discarded – undo
127 129
      */
128 130
     public function shouldBeInFightList()
129 131
     {
130
-        if ($this->belongsToFirstRound() && $this->dontHave2Fighters()) return false;
131
-        if ($this->has2Fighters()) return true;
132
+        if ($this->belongsToFirstRound() && $this->dontHave2Fighters()) {
133
+            return false;
134
+        }
135
+        if ($this->has2Fighters()) {
136
+            return true;
137
+        }
132 138
         // We aint in the first round, and there is 1 or 0 competitor
133 139
         // We check children, and see :
134 140
         // if there is 2  - 2 fighters -> undetermine, we cannot add it to fight list
@@ -157,7 +163,9 @@  discard block
 block discarded – undo
157 163
     private function belongsToFirstRound()
158 164
     {
159 165
         $firstRoundFights = $this->group->championship->firstRoundFights->pluck('id')->toArray();
160
-        if (in_array($this->id, $firstRoundFights)) return true;
166
+        if (in_array($this->id, $firstRoundFights)) {
167
+            return true;
168
+        }
161 169
         return false;
162 170
     }
163 171
 
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
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 foreach ($championship->fightersGroups as $group) {
6 6
     $group->fixTree();
7 7
 }
8
-$directEliminationTree = $championship->fightersGroups->where('round', '>=', $hasPreliminary +1 )->groupBy('round');
8
+$directEliminationTree = $championship->fightersGroups->where('round', '>=', $hasPreliminary + 1)->groupBy('round');
9 9
 
10 10
 $treeGen = new CreateDirectEliminationTree($directEliminationTree, $championship, $hasPreliminary);
11 11
 $treeGen->build();
Please login to merge, or discard this patch.