@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | if ($a->groupResults[$group->id]["points"] === $b->groupResults[$group->id]["points"]) return ($a->groupResults[$group->id]["score"] > $b->groupResults[$group->id]["score"] ? -1 : 1); |
| 19 | 19 | return ($a->groupResults[$group->id]["points"] > $b->groupResults[$group->id]["points"] ? -1 : 1); |
| 20 | 20 | }); |
| 21 | - break;} |
|
| 21 | + break; } |
|
| 22 | 22 | case \TournamentGenerator\Constants::SCORE:{ |
| 23 | 23 | uasort($teams, function($a, $b) use ($group) { |
| 24 | 24 | if ($a->groupResults[$group->id]["score"] === $b->groupResults[$group->id]["score"]) return 0; |
| 25 | 25 | return ($a->groupResults[$group->id]["score"] > $b->groupResults[$group->id]["score"] ? -1 : 1); |
| 26 | 26 | }); |
| 27 | - break;} |
|
| 27 | + break; } |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | return $teams; |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | if ($a->sumPoints($groupsIds) === $b->sumPoints($groupsIds)) return ($a->sumScore($groupsIds) > $b->sumScore($groupsIds) ? -1 : 1); |
| 42 | 42 | return ($a->sumPoints($groupsIds) > $b->sumPoints($groupsIds) ? -1 : 1); |
| 43 | 43 | }); |
| 44 | - break;} |
|
| 44 | + break; } |
|
| 45 | 45 | case \TournamentGenerator\Constants::SCORE:{ |
| 46 | 46 | uasort($teams, function($a, $b) use ($groupsIds) { |
| 47 | 47 | if ($a->sumScore($groupsIds) === $b->sumScore($groupsIds)) return 0; |
| 48 | 48 | return ($a->sumScore($groupsIds) > $b->sumScore($groupsIds) ? -1 : 1); |
| 49 | 49 | }); |
| 50 | - break;} |
|
| 50 | + break; } |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return $teams; |
@@ -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 | } |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | $discard = []; |
| 121 | 121 | shuffle($teams); |
| 122 | 122 | $count = count($teams); |
| 123 | - while (count($teams) % $this->inGame !== 0) { $discard[] = array_shift($teams); } |
|
| 123 | + while (count($teams)%$this->inGame !== 0) { $discard[] = array_shift($teams); } |
|
| 124 | 124 | |
| 125 | 125 | while (count($teams) > 0) { |
| 126 | 126 | $tInGame = []; |
| 127 | - for ($i=0; $i < $this->inGame; $i++) { $tInGame[] = array_shift($teams); } |
|
| 127 | + for ($i = 0; $i < $this->inGame; $i++) { $tInGame[] = array_shift($teams); } |
|
| 128 | 128 | $this->group->game($tInGame); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -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[] = \TournamentGenerator\Constants::DUMMY_TEAM; // IF NOT EVEN NUMBER OF TEAMS, ADD DUMMY |
|
| 168 | + if (count($teams)%2 != 0) $teams[] = \TournamentGenerator\Constants::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); |
@@ -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' => \TournamentGenerator\Constants::ROUND_TWO |