Completed
Push — master ( b13aa8...0a3a64 )
by Julien
11:57
created
src/TreeGen/DirectEliminationTreeGen.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@
 block discarded – undo
190 190
      * @param $numFighters
191 191
      * @return int
192 192
      */
193
-    public function getNumRounds($numFighters){
193
+    public function getNumRounds($numFighters) {
194 194
         return intval(log($numFighters, 2));
195 195
     }
196 196
 }
Please login to merge, or discard this patch.
src/TreeGen/PlayOffTreeGen.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     protected function pushGroups($numRounds, $numFightersElim)
38 38
     {
39 39
         // TODO Here is where you should change when enable several winners for preliminary
40
-        for ($roundNumber = 2; $roundNumber <= $numRounds +1; $roundNumber++) {
40
+        for ($roundNumber = 2; $roundNumber <= $numRounds + 1; $roundNumber++) {
41 41
             // From last match to first match
42 42
             $maxMatches = ($numFightersElim / pow(2, $roundNumber));
43 43
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $numFightersElim = $numFighters / $this->championship->getSettings()->preliminaryGroupSize * 2;
58 58
         // We calculate how much rounds we will have
59
-        $numRounds = intval(log($numFightersElim, 2)) ; // 3 rounds, but begining from round 2 ( ie => 4)
59
+        $numRounds = intval(log($numFightersElim, 2)); // 3 rounds, but begining from round 2 ( ie => 4)
60 60
         $this->pushGroups($numRounds, $numFightersElim);
61 61
     }
62 62
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function generateNextRoundsFights()
105 105
     {
106 106
         $fight = new DirectEliminationFight;
107
-        $fight->saveFights($this->championship,2);
107
+        $fight->saveFights($this->championship, 2);
108 108
     }
109 109
 
110 110
     /**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      * @param $numFighters
113 113
      * @return int
114 114
      */
115
-    public function getNumRounds($numFighters){
115
+    public function getNumRounds($numFighters) {
116 116
         return intval(log($numFighters / $this->championship->getSettings()->preliminaryGroupSize * 2, 2));
117 117
     }
118 118
 }
Please login to merge, or discard this patch.
src/models/Championship.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
     {
30 30
         parent::boot();
31 31
 
32
-        static::deleting(function ($championship) {
32
+        static::deleting(function($championship) {
33 33
             $championship->competitors()->delete();
34 34
             $championship->settings()->delete();
35 35
         });
36
-        static::restoring(function ($championship) {
36
+        static::restoring(function($championship) {
37 37
             $championship->competitors()->restore();
38 38
             $championship->settings()->restore();
39 39
         });
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      */
219 219
     public function groupsFromRound($round)
220 220
     {
221
-        return $this->fightersGroups()->where('round','>=', $round);
221
+        return $this->fightersGroups()->where('round', '>=', $round);
222 222
     }
223 223
 
224 224
     /**
Please login to merge, or discard this patch.