@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | */ |
| 179 | 179 | public static function circle_genGames2(Group $group, array $teams = []) : array { |
| 180 | 180 | |
| 181 | - if (count($teams) % 2 !== 0) { |
|
| 181 | + if (count($teams)%2 !== 0) { |
|
| 182 | 182 | $teams[] = Constants::DUMMY_TEAM; |
| 183 | 183 | } // IF NOT EVEN NUMBER OF TEAMS, ADD DUMMY |
| 184 | 184 | |
| 185 | 185 | shuffle($teams); // SHUFFLE TEAMS FOR MORE RANDOMNESS |
| 186 | 186 | |
| 187 | 187 | $rounds = []; |
| 188 | - for ($i = 0; $i < count($teams) - 1; $i++) { |
|
| 188 | + for ($i = 0; $i < count($teams)-1; $i++) { |
|
| 189 | 189 | $rounds[] = self::circle_saveBracket($teams, $group); // SAVE CURRENT ROUND |
| 190 | 190 | |
| 191 | 191 | $teams = self::circle_rotateBracket($teams); // ROTATE TEAMS IN BRACKET |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | $bracket = []; |
| 209 | 209 | |
| 210 | - for ($i = 0; $i < count($teams) / 2; $i++) { // GO THROUGH HALF OF THE TEAMS |
|
| 210 | + for ($i = 0; $i < count($teams)/2; $i++) { // GO THROUGH HALF OF THE TEAMS |
|
| 211 | 211 | |
| 212 | 212 | $home = $teams[$i]; |
| 213 | 213 | $reverse = array_reverse($teams); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | public static function circle_rotateBracket(array $teams) : array { |
| 236 | 236 | |
| 237 | 237 | $first = array_shift($teams); // THE FIRST TEAM REMAINS FIRST |
| 238 | - $last = array_shift($teams); // THE SECOND TEAM MOVES TO LAST PLACE |
|
| 238 | + $last = array_shift($teams); // THE SECOND TEAM MOVES TO LAST PLACE |
|
| 239 | 239 | |
| 240 | 240 | return array_merge([$first], $teams, [$last]); // MERGE BACK TOGETHER |
| 241 | 241 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | shuffle($teams); |
| 305 | 305 | $count = count($teams); // Store original count for exception |
| 306 | 306 | |
| 307 | - $discard = array_splice($teams, 0, $count % $this->inGame); |
|
| 307 | + $discard = array_splice($teams, 0, $count%$this->inGame); |
|
| 308 | 308 | |
| 309 | 309 | $teams = $this->saveTwoTwoGames($teams); |
| 310 | 310 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $games = []; |
| 334 | 334 | |
| 335 | 335 | // Split teams into chunks of maximum size |
| 336 | - $groups = array_chunk($teams, (int) ceil($count / ceil($count / $this->maxSize))); |
|
| 336 | + $groups = array_chunk($teams, (int) ceil($count/ceil($count/$this->maxSize))); |
|
| 337 | 337 | // Generate games for each chunk |
| 338 | 338 | foreach ($groups as $group) { |
| 339 | 339 | $games[] = $this->r_rGames($group); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @return bool |
| 24 | 24 | */ |
| 25 | 25 | public static function isPowerOf2(int $x) : bool { |
| 26 | - return ($x !== 0) && ($x & ($x - 1)) === 0; |
|
| 26 | + return ($x !== 0) && ($x&($x-1)) === 0; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public static function previousPowerOf2(int $x) : int { |
| 49 | 49 | // Left bit shift by the bit length of the previous number |
| 50 | - return 1 << (strlen(decbin($x)) - 1); |
|
| 50 | + return 1 << (strlen(decbin($x))-1); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |