@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | $this->splitTeams($round1); |
52 | 52 | |
53 | - if (count($this->getTeams()) % 4 == 2) { |
|
53 | + if (count($this->getTeams())%4 == 2) { |
|
54 | 54 | $group_top = $round2->group([ |
55 | 55 | 'name' => 'TOP', |
56 | 56 | 'type' => \TWO_TWO |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $groupIds = []; |
32 | 32 | $allGroups = []; |
33 | 33 | |
34 | - for ($i=1; $i <= $startGroups; $i++) { |
|
34 | + for ($i = 1; $i <= $startGroups; $i++) { |
|
35 | 35 | $g = $startRound->group([ |
36 | 36 | 'name' => 'Start group - '.$i, |
37 | 37 | 'inGame' => 2, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // SPLIT TEAMS EVENLY |
46 | 46 | $this->splitTeams(); |
47 | 47 | |
48 | - for ($r=2; $r <= $roundsNum-1; $r++) { |
|
48 | + for ($r = 2; $r <= $roundsNum-1; $r++) { |
|
49 | 49 | $groups = []; |
50 | 50 | $losingGroups = []; |
51 | 51 | $round = $this->round('Round '.$r); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | private function calcByes(int $countTeams, int &$nextPow) { |
90 | 90 | $byes = 0; |
91 | 91 | $nextPow = $countTeams; |
92 | - if ( !\TournamentGenerator\isPowerOf2($countTeams) ) { |
|
92 | + if (!\TournamentGenerator\isPowerOf2($countTeams)) { |
|
93 | 93 | $nextPow = bindec(str_pad(1, strlen(decbin($countTeams))+1, 0, STR_PAD_RIGHT)); |
94 | 94 | $byes = $nextPow-$countTeams; |
95 | 95 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | private function generateWinSide(int &$r, int &$byes, int &$countTeams, \TournamentGenerator\Round &$round, array &$allGroups, array &$groups, \TournamentGenerator\Group &$lastWinningGroup = null, array &$previousGroups = []) { |
99 | 99 | $order = 1; |
100 | - for ($g=1; $g <= (($countTeams+$byes)/pow(2, $r)); $g++) { |
|
100 | + for ($g = 1; $g <= (($countTeams+$byes)/pow(2, $r)); $g++) { |
|
101 | 101 | $group = $round->group([ |
102 | 102 | 'name' => 'Round '.$r.' - win '.$g, |
103 | 103 | 'inGame' => 2, |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $losingGroupTeamsCount = count($previousLosingGroups)+count($previousGroups); |
118 | 118 | $order = 2; |
119 | 119 | if (\TournamentGenerator\isPowerOf2($losingGroupTeamsCount)) { // IF THE NUMBER OF TEAMS IS A POWER OF 2, GENERATE GROUPS WITHOUT BYES |
120 | - for ($g=1; $g <= $losingGroupTeamsCount/2; $g++) { |
|
120 | + for ($g = 1; $g <= $losingGroupTeamsCount/2; $g++) { |
|
121 | 121 | $group = $round->group([ |
122 | 122 | 'name' => 'Round '.$r.' - loss '.$g, |
123 | 123 | 'inGame' => 2, |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | $n = (floor(count($previousLosingGroups)/2)+$losingByes); |
146 | 146 | $byesGroupsNums = []; |
147 | 147 | $byesProgressed = 0; |
148 | - for ($i=0; $i < $losingByes; $i++) { |
|
148 | + for ($i = 0; $i < $losingByes; $i++) { |
|
149 | 149 | $byesGroupsNums[] = $n-($i*2); |
150 | 150 | } |
151 | 151 | $lastGroup = 0; |
152 | - for ($g=1; $g <= ((count($previousLosingGroups)/2)+$losingByes); $g++) { |
|
152 | + for ($g = 1; $g <= ((count($previousLosingGroups)/2)+$losingByes); $g++) { |
|
153 | 153 | $group = $round->group([ |
154 | 154 | 'name' => 'Round '.$r.' - loss '.$g, |
155 | 155 | 'inGame' => 2, |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | else { |
168 | 168 | $previousLosingGroups[$lastGroup]->progression($group, 0, 1); // PROGRESS FROM LOSING GROUP BEFORE |
169 | - if (isset($previousLosingGroups[$lastGroup + 1])) $previousLosingGroups[$lastGroup + 1]->progression($group, 0, 1); // PROGREESS FROM LOSING GROUP BEFORE |
|
169 | + if (isset($previousLosingGroups[$lastGroup+1])) $previousLosingGroups[$lastGroup+1]->progression($group, 0, 1); // PROGREESS FROM LOSING GROUP BEFORE |
|
170 | 170 | $lastGroup += 2; |
171 | 171 | } |
172 | 172 | } |