@@ -70,7 +70,7 @@ |
||
70 | 70 | { |
71 | 71 | foreach ($players as $mainPlayer) { |
72 | 72 | foreach ($players as $player) { |
73 | - if ($mainPlayer->id() == $player->id()){ |
|
73 | + if ($mainPlayer->id() == $player->id()) { |
|
74 | 74 | continue; |
75 | 75 | } |
76 | 76 | $this->excludePlayers[$mainPlayer->id()][] = $player->id(); |
@@ -73,6 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @param Player[] ...$players |
76 | + * @param Player $players |
|
76 | 77 | */ |
77 | 78 | private function excludePlayers(...$players) |
78 | 79 | { |
@@ -126,7 +127,7 @@ discard block |
||
126 | 127 | } |
127 | 128 | |
128 | 129 | /** |
129 | - * @param array $list |
|
130 | + * @param Player[] $list |
|
130 | 131 | * @return array |
131 | 132 | */ |
132 | 133 | private function shuffleAssoc($list) |
@@ -131,7 +131,9 @@ discard block |
||
131 | 131 | */ |
132 | 132 | private function shuffleAssoc($list) |
133 | 133 | { |
134 | - if (!is_array($list)) return $list; |
|
134 | + if (!is_array($list)) { |
|
135 | + return $list; |
|
136 | + } |
|
135 | 137 | |
136 | 138 | $keys = $this->forceShuffle(array_keys($list)); |
137 | 139 | $random = []; |
@@ -148,7 +150,9 @@ discard block |
||
148 | 150 | */ |
149 | 151 | private function forceShuffle($list) |
150 | 152 | { |
151 | - if (!is_array($list) || count($list) < 2) return $list; |
|
153 | + if (!is_array($list) || count($list) < 2) { |
|
154 | + return $list; |
|
155 | + } |
|
152 | 156 | |
153 | 157 | $shuffleList = $list; |
154 | 158 | while ($shuffleList == $list) { |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | $retry = count($this->players) + $this->players->countExcludePlayers(); |
86 | 86 | |
87 | - while (!$this->isValidCombination() && $retry > 0 ) { |
|
87 | + while (!$this->isValidCombination() && $retry > 0) { |
|
88 | 88 | $this->combination = []; |
89 | 89 | $secretPlayers = $this->players->shufflePlayers(); |
90 | 90 | foreach ($this->players as $playerId => $player) { |