@@ -100,7 +100,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -43,13 +43,13 @@ |
||
| 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 | } |
@@ -135,8 +135,8 @@ |
||
| 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 | |
@@ -60,7 +60,7 @@ |
||
| 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 | }); |
@@ -22,7 +22,7 @@ |
||
| 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); |
@@ -112,18 +112,18 @@ |
||
| 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 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | /* |
| 24 | 24 | * Authenticate the user's personal channel... |
| 25 | 25 | */ |
| 26 | - Broadcast::channel('App.User.*', function ($user, $userId) { |
|
| 26 | + Broadcast::channel('App.User.*', function($user, $userId) { |
|
| 27 | 27 | return (int)$user->id === (int)$userId; |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function registerAuthenticator() |
| 17 | 17 | { |
| 18 | - $this->app->bind('auth', function ($app) { |
|
| 18 | + $this->app->bind('auth', function($app) { |
|
| 19 | 19 | // Once the authentication service has actually been requested by the developer |
| 20 | 20 | // we will set a variable in the application indicating such. This helps us |
| 21 | 21 | // know that we need to set any queued cookies in the after event later. |
| 22 | 22 | $app['auth.loaded'] = true; |
| 23 | 23 | return new AuthManager($app); |
| 24 | 24 | }); |
| 25 | - $this->app->singleton('auth.driver', function ($app) { |
|
| 25 | + $this->app->singleton('auth.driver', function($app) { |
|
| 26 | 26 | // return $app['auth']->driver(); |
| 27 | 27 | return $app['auth']->guard(); |
| 28 | 28 | }); |