Completed
Pull Request — master (#12)
by
unknown
06:39
created
app/Http/Controllers/API/TeamController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers\API;
4 4
 
5
-use App\Http\Requests\Tournament\RemoveTeam;
6 5
 use App\League;
7 6
 use App\Team;
8 7
 use App\TournamentTeam;
Please login to merge, or discard this patch.
app/Http/Controllers/API/TeamMemberController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers\API;
4 4
 
5 5
 use App\Http\Requests\Team\AssignTeamMember;
6
-use App\Http\Requests\Team\RemoveTeamMember;
7 6
 use App\Member;
8 7
 use App\TeamMember;
9 8
 use App\Transformers\TeamMemberSearchTransformer;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,8 +135,8 @@
 block discarded – undo
135 135
         $tournamentId = Input::get('tournamentId');
136 136
         $collection = Member::with(['teamMembers', 'tournamentTeams'])->get();
137 137
 
138
-        $collection = $collection->filter(function ($member) use ($tournamentId) {
139
-            $team = $member->tournamentTeams->first(function ($tournamentTeam) use ($tournamentId) {
138
+        $collection = $collection->filter(function($member) use ($tournamentId) {
139
+            $team = $member->tournamentTeams->first(function($tournamentTeam) use ($tournamentId) {
140 140
                 return $tournamentTeam->tournamentId == $tournamentId;
141 141
             });
142 142
 
Please login to merge, or discard this patch.
app/Http/Controllers/MatchController.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     /**
28 28
      * Store a newly created resource in storage.
29 29
      *
30
-     * @return Response
30
+     * @return \Illuminate\Http\RedirectResponse
31 31
      */
32 32
     public function store()
33 33
     {
Please login to merge, or discard this patch.
app/Http/Requests/MatchUpdate.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
 
67 67
     /**
68
-     * @param $match
68
+     * @param Match $match
69 69
      * @param $tournament
70 70
      * @return bool
71 71
      */
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     }
87 87
 
88 88
     /**
89
-     * @param $match
89
+     * @param Match $match
90 90
      * @param $tournament Tournament
91 91
      * @return bool
92 92
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@
 block discarded – undo
43 43
         $match = Match::findOrFail($matchId)->replicate();
44 44
         $tournament = $match->tournament()->get()->first();
45 45
 
46
-        Validator::extend('round_active', function ($attribute, $value, $parameters) use ($match, $tournament) {
46
+        Validator::extend('round_active', function($attribute, $value, $parameters) use ($match, $tournament) {
47 47
             return $this->isRoundActive($match, $tournament);
48 48
         });
49 49
 
50 50
         Validator::extend(
51 51
             'round_finished_for_pair',
52
-            function ($attribute, $value, $parameters) use ($match, $tournament) {
52
+            function($attribute, $value, $parameters) use ($match, $tournament) {
53 53
                 $match->status = $value;
54 54
                 return $this->isRoundFinishedForPair($match, $tournament);
55 55
             }
Please login to merge, or discard this patch.
app/Jobs/Tournament/DrawKnockOut.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     protected $round;
30 30
 
31 31
     /**
32
-     * @return array
32
+     * @return integer[]
33 33
      */
34 34
     private static function listOfAvailableTeamsAmount()
35 35
     {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
     /**
133 133
      * @name savePairs
134
-     * @param $pairs
134
+     * @param Collection $pairs
135 135
      * @param string $gameType
136 136
      */
137 137
     protected function savePairs($pairs, $gameType = Match::GAME_TYPE_QUALIFY)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,18 +112,18 @@
 block discarded – undo
112 112
 
113 113
             return $this->teams->chunk(2);
114 114
         } else {
115
-            $currentPairs = $tournament->getPairs()->filter(function ($pair) use ($round) {
115
+            $currentPairs = $tournament->getPairs()->filter(function($pair) use ($round) {
116 116
                 return $pair->get('round') === $round - 1;
117 117
             });
118 118
 
119 119
             $roundWinners = new Collection();
120 120
 
121
-            $currentPairs->each(function ($pair) use ($tournament, $roundWinners) {
121
+            $currentPairs->each(function($pair) use ($tournament, $roundWinners) {
122 122
                 // detect pair winner
123 123
                 $roundWinners->push($tournament->getScore($pair->get('matches'))->first());
124 124
             });
125 125
 
126
-            return $this->teams->filter(function ($team) use ($roundWinners) {
126
+            return $this->teams->filter(function($team) use ($roundWinners) {
127 127
                 return $roundWinners->pluck('teamId')->contains($team['id']);
128 128
             })->chunk(2);
129 129
         }
Please login to merge, or discard this patch.
app/Tournament.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     }
57 57
 
58 58
     /**
59
-     * @return array
59
+     * @return string[]
60 60
      */
61 61
     public static function getAvailableMembersType()
62 62
     {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     /**
70
-     * @return array
70
+     * @return string[]
71 71
      */
72 72
     public static function getAvailableTypes()
73 73
     {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     }
80 80
 
81 81
     /**
82
-     * @return array
82
+     * @return string[]
83 83
      */
84 84
     public static function getAvailableStatuses()
85 85
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         // get pairs of current round matches
101 101
         $pairs = new Collection();
102 102
 
103
-        $this->matches->map(function ($match) use ($pairs) {
103
+        $this->matches->map(function($match) use ($pairs) {
104 104
 
105 105
             $pairId = [$match->homeTournamentTeam->id, $match->awayTournamentTeam->id];
106 106
             sort($pairId);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     {
180 180
         $score = new Collection();
181 181
 
182
-        $matches->map(function ($match) use ($score) {
182
+        $matches->map(function($match) use ($score) {
183 183
 
184 184
             $homeTeam = $score->pull($match->homeTournamentTeam->id);
185 185
             $awayTeam = $score->pull($match->awayTournamentTeam->id);
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
                 );
217 217
             }
218 218
 
219
-            $teams =$this->matchScore($match, $homeTeam, $awayTeam);
219
+            $teams = $this->matchScore($match, $homeTeam, $awayTeam);
220 220
             $score->put($match->homeTournamentTeam->id, $teams['homeTeam']);
221 221
             $score->put($match->awayTournamentTeam->id, $teams['awayTeam']);
222 222
         });
223 223
 
224 224
         // sort by points and goal difference
225
-        $score = $score->sort(function ($a, $b) {
225
+        $score = $score->sort(function($a, $b) {
226 226
             if ($b['points'] === $a['points']) {
227 227
                 return $b['goalsDifference'] - $a['goalsDifference'];
228 228
             }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         $previousRow = null;
234 234
         $position = 1;
235
-        $score = $score->map(function ($row) use (&$previousRow, &$position) {
235
+        $score = $score->map(function($row) use (&$previousRow, &$position) {
236 236
             if ($previousRow
237 237
                 && $previousRow['points'] > 0
238 238
                 && $previousRow['points'] == $row['points']
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         });
253 253
 
254 254
         // alphabetical sort for teams on the same position
255
-        $score = $score->sortBy(function ($team) {
255
+        $score = $score->sortBy(function($team) {
256 256
             return $team['position'] . '-' . $team['name'];
257 257
         }, SORT_NUMERIC);
258 258
 
Please login to merge, or discard this patch.
app/Http/Controllers/API/MatchController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
         }
61 61
 
62 62
         if ($teamId) {
63
-            $collection->where(function ($query) use ($teamId) {
63
+            $collection->where(function($query) use ($teamId) {
64 64
                 $query->where('homeTournamentTeamId', $teamId)
65 65
                     ->orWhere('awayTournamentTeamId', $teamId);
66 66
             });
Please login to merge, or discard this patch.
app/Serializers/Tournament/StandingsSerializer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
         $matches = $matches->sortBy('id');
24 24
 
25
-        $matches->map(function ($match) use ($standings) {
25
+        $matches->map(function($match) use ($standings) {
26 26
 
27 27
             $pairId = [$match->homeTournamentTeam->id, $match->awayTournamentTeam->id];
28 28
             sort($pairId);
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         Route::group([
64 64
             'middleware' => 'web',
65 65
             'namespace' => $this->namespace,
66
-        ], function () {
66
+        ], function() {
67 67
             require base_path('routes/web.php');
68 68
         });
69 69
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             'middleware' => 'api',
82 82
             'namespace' => $this->namespace,
83 83
             'prefix' => 'api',
84
-        ], function () {
84
+        ], function() {
85 85
             require base_path('routes/api.php');
86 86
         });
87 87
     }
Please login to merge, or discard this patch.