@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | $this->group = $group; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function allowSkip(){ |
|
| 21 | + public function allowSkip() { |
|
| 22 | 22 | $this->allowSkip = true; |
| 23 | 23 | return $this; |
| 24 | 24 | } |
| 25 | - public function disallowSkip(){ |
|
| 25 | + public function disallowSkip() { |
|
| 26 | 26 | $this->allowSkip = false; |
| 27 | 27 | return $this; |
| 28 | 28 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function setInGame(int $inGame) { |
| 48 | - if ($inGame < 2 || $inGame > 4) throw new \Exception('Expected 2,3 or 4 as inGame '.$inGame.' given'); |
|
| 48 | + if ($inGame < 2 || $inGame > 4) throw new \Exception('Expected 2,3 or 4 as inGame '.$inGame.' given'); |
|
| 49 | 49 | $this->inGame = $inGame; |
| 50 | 50 | return $this; |
| 51 | 51 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | $games = array_merge($games, $gamesTemp); |
| 95 | 95 | } |
| 96 | - break;} |
|
| 96 | + break; } |
|
| 97 | 97 | case 4:{ |
| 98 | 98 | $teamsB = $teams; |
| 99 | 99 | $lockedTeam1 = array_shift($teamsB); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $lockedTeam1 = array_shift($teamsB); |
| 111 | 111 | } |
| 112 | 112 | $games[] = new \TournamentGenerator\Game(array_merge([$lockedTeam1], $teamsB), $this->group); |
| 113 | - break;} |
|
| 113 | + break; } |
|
| 114 | 114 | } |
| 115 | 115 | return $games; |
| 116 | 116 | } |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | $discard = []; |
| 120 | 120 | shuffle($teams); |
| 121 | 121 | $count = count($teams); |
| 122 | - while (count($teams) % $this->inGame !== 0) { $discard[] = array_shift($teams); } |
|
| 122 | + while (count($teams)%$this->inGame !== 0) { $discard[] = array_shift($teams); } |
|
| 123 | 123 | |
| 124 | 124 | while (count($teams) > 0) { |
| 125 | 125 | $tInGame = []; |
| 126 | - for ($i=0; $i < $this->inGame; $i++) { $tInGame[] = array_shift($teams); } |
|
| 126 | + for ($i = 0; $i < $this->inGame; $i++) { $tInGame[] = array_shift($teams); } |
|
| 127 | 127 | $this->group->game($tInGame); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | public static function circle_genGames2(array $teams = [], \tournamentGenerator\Group $group) { |
| 166 | 166 | $bracket = []; // ARRAY OF GAMES |
| 167 | 167 | |
| 168 | - if (count($teams) % 2 != 0) $teams[] = \DUMMY_TEAM; // IF NOT EVEN NUMBER OF TEAMS, ADD DUMMY |
|
| 168 | + if (count($teams)%2 != 0) $teams[] = \DUMMY_TEAM; // IF NOT EVEN NUMBER OF TEAMS, ADD DUMMY |
|
| 169 | 169 | |
| 170 | 170 | shuffle($teams); // SHUFFLE TEAMS FOR MORE RANDOMNESS |
| 171 | 171 | |
| 172 | - for ($i=0; $i < count($teams)-1; $i++) { |
|
| 172 | + for ($i = 0; $i < count($teams)-1; $i++) { |
|
| 173 | 173 | $bracket = array_merge($bracket, Generator::circle_saveBracket($teams, $group)); // SAVE CURRENT ROUND |
| 174 | 174 | |
| 175 | 175 | $teams = Generator::circle_rotateBracket($teams); // ROTATE TEAMS IN BRACKET |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $bracket = []; |
| 185 | 185 | |
| 186 | - for ($i=0; $i < count($teams)/2; $i++) { // GO THROUGH HALF OF THE TEAMS |
|
| 186 | + for ($i = 0; $i < count($teams)/2; $i++) { // GO THROUGH HALF OF THE TEAMS |
|
| 187 | 187 | |
| 188 | 188 | $home = $teams[$i]; |
| 189 | 189 | $reverse = array_reverse($teams); |