| @@ 50-55 (lines=6) @@ | ||
| 47 | if ($group != null) { |
|
| 48 | if ($championship->category->isTeam) { |
|
| 49 | $fighters = $group->teams()->get(); |
|
| 50 | if (sizeof($fighters) == 0) { |
|
| 51 | $fighters->push(new Team()); |
|
| 52 | $fighters->push(new Team()); |
|
| 53 | } else if (count($fighters) % 2 != 0) { |
|
| 54 | $fighters->push(new Team(['name' => 'BYE'])); |
|
| 55 | } |
|
| 56 | return $fighters; |
|
| 57 | } else { |
|
| 58 | $fighters = $group->competitors()->get(); |
|
| @@ 59-64 (lines=6) @@ | ||
| 56 | return $fighters; |
|
| 57 | } else { |
|
| 58 | $fighters = $group->competitors()->get(); |
|
| 59 | if (sizeof($fighters) == 0) { // If |
|
| 60 | $fighters->push(new Competitor()); |
|
| 61 | $fighters->push(new Competitor()); |
|
| 62 | } else if (count($fighters) % 2 != 0) { // If fighter is not pair, add a BYE |
|
| 63 | $fighters->push(new Competitor()); |
|
| 64 | } |
|
| 65 | } |
|
| 66 | return $fighters; |
|
| 67 | } |
|