Completed
Push — master ( df2731...5214c7 )
by Julien
02:35
created
src/models/Fight.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,9 @@  discard block
 block discarded – undo
63 63
      */
64 64
     private static function getActorsToFights(Championship $championship, FightersGroup $group = null)
65 65
     {
66
-        if ($group == null) return null;
66
+        if ($group == null) {
67
+            return null;
68
+        }
67 69
         $fighters = $group->getFighters();
68 70
         $fighterType = $group->getFighterType();
69 71
         if (sizeof($fighters) == 0) {
@@ -276,18 +278,26 @@  discard block
 block discarded – undo
276 278
      */
277 279
     public function hasDeterminedParent()
278 280
     {
279
-        if ($this->has2Fighters()) return true;
281
+        if ($this->has2Fighters()) {
282
+            return true;
283
+        }
280 284
         foreach ($this->group->children as $child) {
281 285
             $fight = $child->fights->get(0);
282
-            if ($fight->has2Fighters()) return false;
286
+            if ($fight->has2Fighters()) {
287
+                return false;
288
+            }
283 289
         }
284 290
         return true;
285 291
     }
286 292
 
287 293
     public function shouldBeInFightList()
288 294
     {
289
-        if ($this->belongsToFirstRound() && $this->dontHave2Fighters()) return false;
290
-        if ($this->has2Fighters()) return true;
295
+        if ($this->belongsToFirstRound() && $this->dontHave2Fighters()) {
296
+            return false;
297
+        }
298
+        if ($this->has2Fighters()) {
299
+            return true;
300
+        }
291 301
         // We aint in the first round, and there is 1 or 0 competitor
292 302
         // We check children, and see :
293 303
         // if there is 2  - 2 fighters -> undetermine, we cannot add it to fight list
@@ -313,7 +323,9 @@  discard block
 block discarded – undo
313 323
     private function belongsToFirstRound()
314 324
     {
315 325
         $firstRoundFights = $this->group->championship->firstRoundFights->pluck('id')->toArray();
316
-        if (in_array($this->id, $firstRoundFights)) return true;
326
+        if (in_array($this->id, $firstRoundFights)) {
327
+            return true;
328
+        }
317 329
         return false;
318 330
     }
319 331
 
Please login to merge, or discard this patch.