| @@ -157,8 +157,9 @@ | ||
| 157 | 157 | |
| 158 | 158 | public function buildName() | 
| 159 | 159 |      { | 
| 160 | - if ($this->settings != null && $this->settings->alias != null && $this->settings->alias != '') | |
| 161 | - return $this->settings->alias; | |
| 160 | +        if ($this->settings != null && $this->settings->alias != null && $this->settings->alias != '') { | |
| 161 | + return $this->settings->alias; | |
| 162 | + } | |
| 162 | 163 | |
| 163 | 164 |          if ($this->hasNoCustomSettings()) { | 
| 164 | 165 | return $this->category->name; | 
| @@ -2,7 +2,6 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Xoco70\KendoTournaments\TreeGen; | 
| 4 | 4 | |
| 5 | -use App\User; | |
| 6 | 5 | use Illuminate\Support\Collection; | 
| 7 | 6 | use Xoco70\KendoTournaments\Contracts\TreeGenerable; | 
| 8 | 7 | use Xoco70\KendoTournaments\Exceptions\TreeGenerationException; | 
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | |
| 7 | 7 | $fighter1 = $item->team1 != null ? $item->team1->name : "Bye"; | 
| 8 | 8 | $fighter2 = $item->team2 != null ? $item->team2->name : "Bye"; | 
| 9 | -    }else{ | |
| 9 | +    } else{ | |
| 10 | 10 | $fighter1 = $item->competitors->get(0) != null ? $item->competitors->get(0)->user->name : "Bye"; | 
| 11 | 11 | $fighter2 = $item->competitors->get(1) != null ? $item->competitors->get(1)->user->name : "Bye"; | 
| 12 | 12 | |
| @@ -45,7 +45,9 @@ | ||
| 45 | 45 | |
| 46 | 46 | public function getName() | 
| 47 | 47 |      { | 
| 48 | - if ($this == null) return "BYE"; | |
| 48 | +        if ($this == null) { | |
| 49 | + return "BYE"; | |
| 50 | + } | |
| 49 | 51 | return $this->name; | 
| 50 | 52 | } | 
| 51 | 53 | |
| @@ -65,7 +65,9 @@ discard block | ||
| 65 | 65 | $matches = array_chunk($fighters, 2); | 
| 66 | 66 | |
| 67 | 67 | //If there's already a match in the match array, then that means the next round is round 2, so increase the round number | 
| 68 | - if (count($this->brackets)) $roundNumber++; | |
| 68 | +        if (count($this->brackets)) { | |
| 69 | + $roundNumber++; | |
| 70 | + } | |
| 69 | 71 | |
| 70 | 72 | $countMatches = count($matches); | 
| 71 | 73 | //Create the first full round of fighters, some may be blank if waiting on the results of a previous round | 
| @@ -80,7 +82,7 @@ discard block | ||
| 80 | 82 |                  if ($this->championship->category->isTeam()){ | 
| 81 | 83 | $fighter1 = $this->names->get($roundNumber)[0]->fights[$matchNumber-1]->team1; | 
| 82 | 84 | $fighter2 = $this->names->get($roundNumber)[0]->fights[$matchNumber-1]->team2; | 
| 83 | -                }else{ | |
| 85 | +                } else{ | |
| 84 | 86 | $fighter1 = $this->names->get($roundNumber)[$matchNumber-1]->fights[0]->competitor1; | 
| 85 | 87 | $fighter2 = $this->names->get($roundNumber)[$matchNumber-1]->fights[0]->competitor2; | 
| 86 | 88 | } | 
| @@ -86,15 +86,23 @@ | ||
| 86 | 86 | |
| 87 | 87 | public function getName() | 
| 88 | 88 |      { | 
| 89 | - if ($this == null) return "BYE"; | |
| 90 | - if ($this->user == null) return "BYE"; | |
| 89 | +        if ($this == null) { | |
| 90 | + return "BYE"; | |
| 91 | + } | |
| 92 | +        if ($this->user == null) { | |
| 93 | + return "BYE"; | |
| 94 | + } | |
| 91 | 95 | return $this->user->name; | 
| 92 | 96 | } | 
| 93 | 97 | |
| 94 | 98 | public function getFullName() | 
| 95 | 99 |      { | 
| 96 | - if ($this == null) return "BYE"; | |
| 97 | - if ($this->user == null) return "BYE"; | |
| 100 | +        if ($this == null) { | |
| 101 | + return "BYE"; | |
| 102 | + } | |
| 103 | +        if ($this->user == null) { | |
| 104 | + return "BYE"; | |
| 105 | + } | |
| 98 | 106 | return $this->user->firstname . " " . $this->user->lastname; | 
| 99 | 107 | } | 
| 100 | 108 | |