@@ -121,14 +121,14 @@ discard block |
||
| 121 | 121 | return $this->sumScore; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - public function addWin(string $groupId = ''){ |
|
| 124 | + public function addWin(string $groupId = '') { |
|
| 125 | 125 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 126 | 126 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->winPoints; |
| 127 | 127 | $this->sumPoints += $this->groupResults[$groupId]['group']->winPoints; |
| 128 | 128 | $this->groupResults[$groupId]['wins']++; |
| 129 | 129 | return $this; |
| 130 | 130 | } |
| 131 | - public function removeWin(string $groupId = ''){ |
|
| 131 | + public function removeWin(string $groupId = '') { |
|
| 132 | 132 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 133 | 133 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->winPoints; |
| 134 | 134 | $this->sumPoints -= $this->groupResults[$groupId]['group']->winPoints; |
@@ -136,14 +136,14 @@ discard block |
||
| 136 | 136 | return $this; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - public function addDraw(string $groupId = ''){ |
|
| 139 | + public function addDraw(string $groupId = '') { |
|
| 140 | 140 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 141 | 141 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->drawPoints; |
| 142 | 142 | $this->sumPoints += $this->groupResults[$groupId]['group']->drawPoints; |
| 143 | 143 | $this->groupResults[$groupId]['draws']++; |
| 144 | 144 | return $this; |
| 145 | 145 | } |
| 146 | - public function removeDraw(string $groupId = ''){ |
|
| 146 | + public function removeDraw(string $groupId = '') { |
|
| 147 | 147 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 148 | 148 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->drawPoints; |
| 149 | 149 | $this->sumPoints -= $this->groupResults[$groupId]['group']->drawPoints; |
@@ -151,14 +151,14 @@ discard block |
||
| 151 | 151 | return $this; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public function addLoss(string $groupId = ''){ |
|
| 154 | + public function addLoss(string $groupId = '') { |
|
| 155 | 155 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 156 | 156 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->lostPoints; |
| 157 | 157 | $this->sumPoints += $this->groupResults[$groupId]['group']->lostPoints; |
| 158 | 158 | $this->groupResults[$groupId]['losses']++; |
| 159 | 159 | return $this; |
| 160 | 160 | } |
| 161 | - public function removeLoss(string $groupId = ''){ |
|
| 161 | + public function removeLoss(string $groupId = '') { |
|
| 162 | 162 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 163 | 163 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->lostPoints; |
| 164 | 164 | $this->sumPoints -= $this->groupResults[$groupId]['group']->lostPoints; |
@@ -166,14 +166,14 @@ discard block |
||
| 166 | 166 | return $this; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - public function addSecond(string $groupId = ''){ |
|
| 169 | + public function addSecond(string $groupId = '') { |
|
| 170 | 170 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 171 | 171 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->secondPoints; |
| 172 | 172 | $this->sumPoints += $this->groupResults[$groupId]['group']->secondPoints; |
| 173 | 173 | $this->groupResults[$groupId]['second']++; |
| 174 | 174 | return $this; |
| 175 | 175 | } |
| 176 | - public function removeSecond(string $groupId = ''){ |
|
| 176 | + public function removeSecond(string $groupId = '') { |
|
| 177 | 177 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 178 | 178 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->secondPoints; |
| 179 | 179 | $this->sumPoints -= $this->groupResults[$groupId]['group']->secondPoints; |
@@ -181,14 +181,14 @@ discard block |
||
| 181 | 181 | return $this; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - public function addThird(string $groupId = ''){ |
|
| 184 | + public function addThird(string $groupId = '') { |
|
| 185 | 185 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 186 | 186 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->thirdPoints; |
| 187 | 187 | $this->sumPoints += $this->groupResults[$groupId]['group']->thirdPoints; |
| 188 | 188 | $this->groupResults[$groupId]['third']++; |
| 189 | 189 | return $this; |
| 190 | 190 | } |
| 191 | - public function removeThird(string $groupId = ''){ |
|
| 191 | + public function removeThird(string $groupId = '') { |
|
| 192 | 192 | if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
| 193 | 193 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->thirdPoints; |
| 194 | 194 | $this->sumPoints -= $this->groupResults[$groupId]['group']->thirdPoints; |
@@ -75,20 +75,26 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | public function getGroupResults($groupId = null) { |
| 77 | 77 | if (isset($groupId)) { |
| 78 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Trying to get unexisting group results ('.$groupId.')'); |
|
| 78 | + if (!isset($this->groupResults[$groupId])) { |
|
| 79 | + throw new \Exception('Trying to get unexisting group results ('.$groupId.')'); |
|
| 80 | + } |
|
| 79 | 81 | return $this->groupResults[$groupId]; |
| 80 | 82 | } |
| 81 | 83 | return $this->groupResults; |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | public function addGameWith(Team $team, Group $group) { |
| 85 | - if (!isset($this->gamesWith[$group->getId()][$team->getId()])) $this->gamesWith[$group->getId()][$team->getId()] = 0; |
|
| 87 | + if (!isset($this->gamesWith[$group->getId()][$team->getId()])) { |
|
| 88 | + $this->gamesWith[$group->getId()][$team->getId()] = 0; |
|
| 89 | + } |
|
| 86 | 90 | $this->gamesWith[$group->getId()][$team->getId()]++; |
| 87 | 91 | return $this; |
| 88 | 92 | } |
| 89 | 93 | public function getGameWith(Team $team = null, Group $group = null) { |
| 90 | 94 | if (isset($group)) { |
| 91 | - if (isset($team)) return $this->gamesWith[$group->getId()][$team->getId()]; |
|
| 95 | + if (isset($team)) { |
|
| 96 | + return $this->gamesWith[$group->getId()][$team->getId()]; |
|
| 97 | + } |
|
| 92 | 98 | return $this->gamesWith[$group->getId()]; |
| 93 | 99 | } |
| 94 | 100 | if (isset($team)) { |
@@ -97,19 +103,25 @@ discard block |
||
| 97 | 103 | $filter = array_filter($games, function($key) use ($team){ |
| 98 | 104 | return $key === $team->getId(); |
| 99 | 105 | }, ARRAY_FILTER_USE_KEY); |
| 100 | - if (count($filter) > 0) $return[$id] = $filter; |
|
| 106 | + if (count($filter) > 0) { |
|
| 107 | + $return[$id] = $filter; |
|
| 108 | + } |
|
| 101 | 109 | } |
| 102 | 110 | return $return; |
| 103 | 111 | } |
| 104 | 112 | return $this->gamesWith; |
| 105 | 113 | } |
| 106 | 114 | public function addGroup(Group $group) { |
| 107 | - if (!isset($this->games[$group->getId()])) $this->games[$group->getId()] = []; |
|
| 115 | + if (!isset($this->games[$group->getId()])) { |
|
| 116 | + $this->games[$group->getId()] = []; |
|
| 117 | + } |
|
| 108 | 118 | return $this; |
| 109 | 119 | } |
| 110 | 120 | public function addGame(Game $game) { |
| 111 | 121 | $group = $game->getGroup(); |
| 112 | - if (!isset($this->games[$group->getId()])) $this->games[$group->getId()] = []; |
|
| 122 | + if (!isset($this->games[$group->getId()])) { |
|
| 123 | + $this->games[$group->getId()] = []; |
|
| 124 | + } |
|
| 113 | 125 | $this->games[$group->getId()][] = $game; |
| 114 | 126 | return $this; |
| 115 | 127 | } |
@@ -122,14 +134,18 @@ discard block |
||
| 122 | 134 | } |
| 123 | 135 | |
| 124 | 136 | public function addWin(string $groupId = ''){ |
| 125 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 137 | + if (!isset($this->groupResults[$groupId])) { |
|
| 138 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 139 | + } |
|
| 126 | 140 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->winPoints; |
| 127 | 141 | $this->sumPoints += $this->groupResults[$groupId]['group']->winPoints; |
| 128 | 142 | $this->groupResults[$groupId]['wins']++; |
| 129 | 143 | return $this; |
| 130 | 144 | } |
| 131 | 145 | public function removeWin(string $groupId = ''){ |
| 132 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 146 | + if (!isset($this->groupResults[$groupId])) { |
|
| 147 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 148 | + } |
|
| 133 | 149 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->winPoints; |
| 134 | 150 | $this->sumPoints -= $this->groupResults[$groupId]['group']->winPoints; |
| 135 | 151 | $this->groupResults[$groupId]['wins']--; |
@@ -137,14 +153,18 @@ discard block |
||
| 137 | 153 | } |
| 138 | 154 | |
| 139 | 155 | public function addDraw(string $groupId = ''){ |
| 140 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 156 | + if (!isset($this->groupResults[$groupId])) { |
|
| 157 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 158 | + } |
|
| 141 | 159 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->drawPoints; |
| 142 | 160 | $this->sumPoints += $this->groupResults[$groupId]['group']->drawPoints; |
| 143 | 161 | $this->groupResults[$groupId]['draws']++; |
| 144 | 162 | return $this; |
| 145 | 163 | } |
| 146 | 164 | public function removeDraw(string $groupId = ''){ |
| 147 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 165 | + if (!isset($this->groupResults[$groupId])) { |
|
| 166 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 167 | + } |
|
| 148 | 168 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->drawPoints; |
| 149 | 169 | $this->sumPoints -= $this->groupResults[$groupId]['group']->drawPoints; |
| 150 | 170 | $this->groupResults[$groupId]['draws']--; |
@@ -152,14 +172,18 @@ discard block |
||
| 152 | 172 | } |
| 153 | 173 | |
| 154 | 174 | public function addLoss(string $groupId = ''){ |
| 155 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 175 | + if (!isset($this->groupResults[$groupId])) { |
|
| 176 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 177 | + } |
|
| 156 | 178 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->lostPoints; |
| 157 | 179 | $this->sumPoints += $this->groupResults[$groupId]['group']->lostPoints; |
| 158 | 180 | $this->groupResults[$groupId]['losses']++; |
| 159 | 181 | return $this; |
| 160 | 182 | } |
| 161 | 183 | public function removeLoss(string $groupId = ''){ |
| 162 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 184 | + if (!isset($this->groupResults[$groupId])) { |
|
| 185 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 186 | + } |
|
| 163 | 187 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->lostPoints; |
| 164 | 188 | $this->sumPoints -= $this->groupResults[$groupId]['group']->lostPoints; |
| 165 | 189 | $this->groupResults[$groupId]['losses']--; |
@@ -167,14 +191,18 @@ discard block |
||
| 167 | 191 | } |
| 168 | 192 | |
| 169 | 193 | public function addSecond(string $groupId = ''){ |
| 170 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 194 | + if (!isset($this->groupResults[$groupId])) { |
|
| 195 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 196 | + } |
|
| 171 | 197 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->secondPoints; |
| 172 | 198 | $this->sumPoints += $this->groupResults[$groupId]['group']->secondPoints; |
| 173 | 199 | $this->groupResults[$groupId]['second']++; |
| 174 | 200 | return $this; |
| 175 | 201 | } |
| 176 | 202 | public function removeSecond(string $groupId = ''){ |
| 177 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 203 | + if (!isset($this->groupResults[$groupId])) { |
|
| 204 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 205 | + } |
|
| 178 | 206 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->secondPoints; |
| 179 | 207 | $this->sumPoints -= $this->groupResults[$groupId]['group']->secondPoints; |
| 180 | 208 | $this->groupResults[$groupId]['second']--; |
@@ -182,14 +210,18 @@ discard block |
||
| 182 | 210 | } |
| 183 | 211 | |
| 184 | 212 | public function addThird(string $groupId = ''){ |
| 185 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 213 | + if (!isset($this->groupResults[$groupId])) { |
|
| 214 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 215 | + } |
|
| 186 | 216 | $this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->thirdPoints; |
| 187 | 217 | $this->sumPoints += $this->groupResults[$groupId]['group']->thirdPoints; |
| 188 | 218 | $this->groupResults[$groupId]['third']++; |
| 189 | 219 | return $this; |
| 190 | 220 | } |
| 191 | 221 | public function removeThird(string $groupId = ''){ |
| 192 | - if (!isset($this->groupResults[$groupId])) throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 222 | + if (!isset($this->groupResults[$groupId])) { |
|
| 223 | + throw new \Exception('Group '.$groupId.' is not set for this team ('.$this->name.')'); |
|
| 224 | + } |
|
| 193 | 225 | $this->groupResults[$groupId]['points'] -= $this->groupResults[$groupId]['group']->thirdPoints; |
| 194 | 226 | $this->sumPoints -= $this->groupResults[$groupId]['group']->thirdPoints; |
| 195 | 227 | $this->groupResults[$groupId]['third']--; |
@@ -197,7 +229,9 @@ discard block |
||
| 197 | 229 | } |
| 198 | 230 | |
| 199 | 231 | public function sumPoints(array $groupIds = []) { |
| 200 | - if (count($groupIds) === 0) return $this->sumPoints; |
|
| 232 | + if (count($groupIds) === 0) { |
|
| 233 | + return $this->sumPoints; |
|
| 234 | + } |
|
| 201 | 235 | $sum = 0; |
| 202 | 236 | foreach ($groupIds as $gid) { |
| 203 | 237 | $sum += $this->groupResults[$gid]['points'] ?? 0; |
@@ -205,7 +239,9 @@ discard block |
||
| 205 | 239 | return $sum; |
| 206 | 240 | } |
| 207 | 241 | public function sumScore(array $groupIds = []) { |
| 208 | - if (count($groupIds) === 0) return $this->sumScore; |
|
| 242 | + if (count($groupIds) === 0) { |
|
| 243 | + return $this->sumScore; |
|
| 244 | + } |
|
| 209 | 245 | $sum = 0; |
| 210 | 246 | foreach ($groupIds as $gid) { |
| 211 | 247 | $sum += $this->groupResults[$gid]['score'] ?? 0; |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | if (count($error) > 0) throw new \Exception('Trying to add teams ('.count($error).') that are not instance of Team class'.PHP_EOL.print_r($error, true)); |
| 67 | 67 | return $this; |
| 68 | 68 | } |
| 69 | - public function getTeams(){ |
|
| 69 | + public function getTeams() { |
|
| 70 | 70 | return $this->teams; |
| 71 | 71 | } |
| 72 | - public function getTeamsIds(){ |
|
| 73 | - return array_map(function($a){ return $a->getId(); }, $this->teams); |
|
| 72 | + public function getTeamsIds() { |
|
| 73 | + return array_map(function($a) { return $a->getId(); }, $this->teams); |
|
| 74 | 74 | } |
| 75 | 75 | public function getTeam($id) { |
| 76 | - $key = array_search($id, array_map(function($a){ return $a->getId();}, $this->teams)); |
|
| 76 | + $key = array_search($id, array_map(function($a) { return $a->getId(); }, $this->teams)); |
|
| 77 | 77 | return ($key !== false ? $this->teams[$key] : false); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return $this; |
| 111 | 111 | } |
| 112 | 112 | private function setResults2($i, $score, $results, $team) { |
| 113 | - if (count(array_filter($results, function($a) use ($score){return $a === $score;})) > 1) { |
|
| 113 | + if (count(array_filter($results, function($a) use ($score){return $a === $score; })) > 1) { |
|
| 114 | 114 | $this->drawIds[] = $team->getId(); |
| 115 | 115 | $team->addDraw($this->group->getId()); |
| 116 | 116 | $this->results[$team->getId()] += ['points' => $this->group->drawPoints, 'type' => 'draw']; |
@@ -33,11 +33,15 @@ discard block |
||
| 33 | 33 | $this->teams = $teams; |
| 34 | 34 | foreach ($this->teams as $team) { |
| 35 | 35 | foreach ($this->teams as $team2) { |
| 36 | - if ($team === $team2) continue; |
|
| 36 | + if ($team === $team2) { |
|
| 37 | + continue; |
|
| 38 | + } |
|
| 37 | 39 | $team->addGameWith($team2, $group); |
| 38 | 40 | } |
| 39 | 41 | } |
| 40 | - if (count($error) > 0) throw new \Exception('Trying to add teams ('.count($error).') that are not instance of Team class'.PHP_EOL.print_r($error, true)); |
|
| 42 | + if (count($error) > 0) { |
|
| 43 | + throw new \Exception('Trying to add teams ('.count($error).') that are not instance of Team class'.PHP_EOL.print_r($error, true)); |
|
| 44 | + } |
|
| 41 | 45 | } |
| 42 | 46 | |
| 43 | 47 | public function getGroup() { |
@@ -56,14 +60,18 @@ discard block |
||
| 56 | 60 | $team->addGame($this); |
| 57 | 61 | |
| 58 | 62 | foreach ($this->teams as $team2) { |
| 59 | - if ($team === $team2) continue; |
|
| 63 | + if ($team === $team2) { |
|
| 64 | + continue; |
|
| 65 | + } |
|
| 60 | 66 | if ($team instanceof Team) { |
| 61 | 67 | $team->addGameWith($team2, $this->group); |
| 62 | 68 | $team2->addGameWith($team, $this->group); |
| 63 | 69 | } |
| 64 | 70 | } |
| 65 | 71 | } |
| 66 | - if (count($error) > 0) throw new \Exception('Trying to add teams ('.count($error).') that are not instance of Team class'.PHP_EOL.print_r($error, true)); |
|
| 72 | + if (count($error) > 0) { |
|
| 73 | + throw new \Exception('Trying to add teams ('.count($error).') that are not instance of Team class'.PHP_EOL.print_r($error, true)); |
|
| 74 | + } |
|
| 67 | 75 | return $this; |
| 68 | 76 | } |
| 69 | 77 | public function getTeams(){ |
@@ -83,14 +91,20 @@ discard block |
||
| 83 | 91 | * ) |
| 84 | 92 | */ |
| 85 | 93 | public function setResults(array $results = []) { |
| 86 | - if (count($this->results) === 0) $this->resetResults(); |
|
| 94 | + if (count($this->results) === 0) { |
|
| 95 | + $this->resetResults(); |
|
| 96 | + } |
|
| 87 | 97 | arsort($results); |
| 88 | 98 | $inGame = /** @scrutinizer ignore-call */ $this->group->getInGame(); |
| 89 | 99 | $i = 1; |
| 90 | 100 | foreach ($results as $id => $score) { |
| 91 | - if (!is_numeric($score)) throw new \TypeError('Score passed to TournamentGenerator\Game::setResults() must be of the type numeric, '.gettype($score).' given'); |
|
| 101 | + if (!is_numeric($score)) { |
|
| 102 | + throw new \TypeError('Score passed to TournamentGenerator\Game::setResults() must be of the type numeric, '.gettype($score).' given'); |
|
| 103 | + } |
|
| 92 | 104 | $team = $this->getTeam($id); |
| 93 | - if (!$team instanceof Team) throw new \Exception('Couldn\'t find team with id of "'.$id.'"'); |
|
| 105 | + if (!$team instanceof Team) { |
|
| 106 | + throw new \Exception('Couldn\'t find team with id of "'.$id.'"'); |
|
| 107 | + } |
|
| 94 | 108 | $this->results[$team->getId()] = ['score' => $score]; |
| 95 | 109 | $team->addScore($score); |
| 96 | 110 | switch ($inGame) { |
@@ -114,13 +128,11 @@ discard block |
||
| 114 | 128 | $this->drawIds[] = $team->getId(); |
| 115 | 129 | $team->addDraw($this->group->getId()); |
| 116 | 130 | $this->results[$team->getId()] += ['points' => $this->group->drawPoints, 'type' => 'draw']; |
| 117 | - } |
|
| 118 | - elseif ($i === 1) { |
|
| 131 | + } elseif ($i === 1) { |
|
| 119 | 132 | $this->winId = $team->getId(); |
| 120 | 133 | $team->addWin($this->group->getId()); |
| 121 | 134 | $this->results[$team->getId()] += ['points' => $this->group->winPoints, 'type' => 'win']; |
| 122 | - } |
|
| 123 | - else { |
|
| 135 | + } else { |
|
| 124 | 136 | $this->lossId = $team->getId(); |
| 125 | 137 | $team->addLoss($this->group->getId()); |
| 126 | 138 | $this->results[$team->getId()] += ['points' => $this->group->lostPoints, 'type' => 'loss']; |
@@ -220,7 +232,9 @@ discard block |
||
| 220 | 232 | } |
| 221 | 233 | |
| 222 | 234 | public function isPlayed() { |
| 223 | - if (count($this->results) > 0) return true; |
|
| 235 | + if (count($this->results) > 0) { |
|
| 236 | + return true; |
|
| 237 | + } |
|
| 224 | 238 | return false; |
| 225 | 239 | } |
| 226 | 240 | } |