Passed
Push — master ( 12f4b8...835fc7 )
by Julien
06:42
created
database/factories/VenueFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
database/factories/CategoryFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
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',
Please login to merge, or discard this patch.
database/factories/ChampionshipFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
database/factories/TeamFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/TreeController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@
 block discarded – undo
81 81
     {
82 82
         if ($isTeam) {
83 83
             $championship = Championship::find(2);
84
-            factory(Team::class, (int) $numFighters)->create(['championship_id' => $championship->id]);
84
+            factory(Team::class, (int)$numFighters)->create(['championship_id' => $championship->id]);
85 85
         } else {
86 86
             $championship = Championship::find(1);
87
-            $users = factory(User::class, (int) $numFighters)->create();
87
+            $users = factory(User::class, (int)$numFighters)->create();
88 88
             foreach ($users as $user) {
89 89
                 factory(Competitor::class)->create(
90 90
                     ['championship_id' => $championship->id,
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @param Request $request
39 39
      *
40
-     * @return \Illuminate\Http\Response|string
40
+     * @return \Illuminate\Http\RedirectResponse
41 41
      */
42 42
     public function store(Request $request, $championshipId)
43 43
     {
@@ -137,6 +137,9 @@  discard block
 block discarded – undo
137 137
         return back();
138 138
     }
139 139
 
140
+    /**
141
+     * @param integer $numFighter
142
+     */
140 143
     public function getWinnerId($fighters, $scores, $numFighter)
141 144
     {
142 145
         return $scores[$numFighter] != null ? $fighters[$numFighter] : null;
Please login to merge, or discard this patch.
src/Models/Competitor.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
database/factories/ChampionshipSettingsFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Models/Fight.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,15 +112,15 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
151 151
     }
152 152
 
153 153
     /**
154
+     * @param boolean $default
154 155
      * @return bool
155 156
      */
156 157
     public function shouldBeInFightList($default)
Please login to merge, or discard this patch.
src/Models/Championship.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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()
Please login to merge, or discard this patch.