@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Xoco70\LaravelTournaments\Models\Venue; |
| 4 | 4 | |
| 5 | -$factory->define(Venue::class, function (Faker\Generator $faker) { |
|
| 5 | +$factory->define(Venue::class, function(Faker\Generator $faker) { |
|
| 6 | 6 | return [ |
| 7 | 7 | 'venue_name' => $faker->colorName, |
| 8 | 8 | 'address' => $faker->streetName, |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Xoco70\LaravelTournaments\Models\Category as Cat; |
| 5 | 5 | |
| 6 | -$factory->define(Cat::class, function (Faker\Generator $faker) { |
|
| 6 | +$factory->define(Cat::class, function(Faker\Generator $faker) { |
|
| 7 | 7 | $name = ['categories.junior', |
| 8 | 8 | 'categories.junior_team', |
| 9 | 9 | 'categories.men_single', |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Xoco70\LaravelTournaments\Models\Championship; |
| 6 | 6 | use Xoco70\LaravelTournaments\Models\Tournament; |
| 7 | 7 | |
| 8 | -$factory->define(Championship::class, function (Faker\Generator $faker) { |
|
| 8 | +$factory->define(Championship::class, function(Faker\Generator $faker) { |
|
| 9 | 9 | $tournaments = Tournament::all()->pluck('id')->toArray(); |
| 10 | 10 | $categories = Cat::all()->pluck('id')->toArray(); |
| 11 | 11 | |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Xoco70\LaravelTournaments\Models\Team; |
| 4 | 4 | |
| 5 | -$factory->define(Team::class, function (Faker\Generator $faker) { |
|
| 5 | +$factory->define(Team::class, function(Faker\Generator $faker) { |
|
| 6 | 6 | return [ |
| 7 | 7 | 'name' => $faker->name, |
| 8 | 8 | 'championship_id' => 2, |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function getFullName() //TODO Should remove get prefix |
| 43 | 43 | { |
| 44 | - return $this->defaultName() ?? $this->user->firstname.' '.$this->user->lastname; |
|
| 44 | + return $this->defaultName() ?? $this->user->firstname . ' ' . $this->user->lastname; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * Get User from Competitor. |
| 21 | 21 | * |
| 22 | - * @return mixed |
|
| 22 | + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
|
| 23 | 23 | */ |
| 24 | 24 | public function user() |
| 25 | 25 | { |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Xoco70\LaravelTournaments\Models\Championship; |
| 5 | 5 | use Xoco70\LaravelTournaments\Models\ChampionshipSettings; |
| 6 | 6 | |
| 7 | -$factory->define(ChampionshipSettings::class, function (Faker\Generator $faker) use ($factory) { |
|
| 7 | +$factory->define(ChampionshipSettings::class, function(Faker\Generator $faker) use ($factory) { |
|
| 8 | 8 | $tcs = Championship::all()->pluck('id')->toArray(); |
| 9 | 9 | |
| 10 | 10 | $fightingAreas = [1, 2, 4, 8]; |
@@ -112,15 +112,15 @@ |
||
| 112 | 112 | { |
| 113 | 113 | $isTeam = $this->group->championship->category->isTeam; |
| 114 | 114 | if ($isTeam) { |
| 115 | - $teamToUpdate = 'team'.$numFighter; |
|
| 115 | + $teamToUpdate = 'team' . $numFighter; |
|
| 116 | 116 | |
| 117 | 117 | return optional($this->$teamToUpdate)->$attr; |
| 118 | 118 | } |
| 119 | - $competitorToUpdate = 'competitor'.$numFighter; |
|
| 119 | + $competitorToUpdate = 'competitor' . $numFighter; |
|
| 120 | 120 | if ($attr == 'name') { |
| 121 | 121 | return $this->$competitorToUpdate == null |
| 122 | 122 | ? '' |
| 123 | - : $this->$competitorToUpdate->user->firstname.' '.$this->$competitorToUpdate->user->lastname; |
|
| 123 | + : $this->$competitorToUpdate->user->firstname . ' ' . $this->$competitorToUpdate->user->lastname; |
|
| 124 | 124 | } elseif ($attr == 'short_id') { |
| 125 | 125 | return optional($this->$competitorToUpdate)->short_id; |
| 126 | 126 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | - * @param FightersGroup|null $group |
|
| 44 | + * @param FightersGroup $group |
|
| 45 | 45 | * |
| 46 | 46 | * @return Collection |
| 47 | 47 | */ |
@@ -151,6 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | + * @param boolean $default |
|
| 154 | 155 | * @return bool |
| 155 | 156 | */ |
| 156 | 157 | public function shouldBeInFightList($default) |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | parent::boot(); |
| 30 | 30 | |
| 31 | - static::deleting(function ($championship) { |
|
| 31 | + static::deleting(function($championship) { |
|
| 32 | 32 | $championship->competitors()->delete(); |
| 33 | 33 | $championship->settings()->delete(); |
| 34 | 34 | }); |
| 35 | - static::restoring(function ($championship) { |
|
| 35 | + static::restoring(function($championship) { |
|
| 36 | 36 | $championship->competitors()->restore(); |
| 37 | 37 | $championship->settings()->restore(); |
| 38 | 38 | }); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $ageCategoryText = $this->category->getAgeString(); |
| 196 | 196 | $gradeText = $this->category->getGradeString(); |
| 197 | 197 | |
| 198 | - return $teamText.' '.$genders[$this->category->gender].' '.$ageCategoryText.' '.$gradeText; |
|
| 198 | + return $teamText . ' ' . $genders[$this->category->gender] . ' ' . $ageCategoryText . ' ' . $gradeText; |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | public function getSettings() |
@@ -57,13 +57,13 @@ |
||
| 57 | 57 | protected static function boot() |
| 58 | 58 | { |
| 59 | 59 | parent::boot(); |
| 60 | - static::deleting(function ($tournament) { |
|
| 60 | + static::deleting(function($tournament) { |
|
| 61 | 61 | foreach ($tournament->championships as $ct) { |
| 62 | 62 | $ct->delete(); |
| 63 | 63 | } |
| 64 | 64 | // $tournament->invites()->delete(); |
| 65 | 65 | }); |
| 66 | - static::restoring(function ($tournament) { |
|
| 66 | + static::restoring(function($tournament) { |
|
| 67 | 67 | foreach ($tournament->championships()->withTrashed()->get() as $ct) { |
| 68 | 68 | $ct->restore(); |
| 69 | 69 | } |