@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function boot() |
18 | 18 | { |
19 | - Auth::macro('student', function () { |
|
19 | + Auth::macro('student', function() { |
|
20 | 20 | return Auth::check() ? Auth::user()->student : null; |
21 | 21 | }); |
22 | 22 | |
23 | - Validator::extend('student_number', function ($attribute, $value, $parameters, $validator) { |
|
23 | + Validator::extend('student_number', function($attribute, $value, $parameters, $validator) { |
|
24 | 24 | return preg_match('/^(a|pg)[0-9]+$/', $value) === 1; |
25 | 25 | }); |
26 | 26 | } |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function register() |
32 | 32 | { |
33 | - $this->app->singleton(ExchangeRegistry::class, function ($app) { |
|
33 | + $this->app->singleton(ExchangeRegistry::class, function($app) { |
|
34 | 34 | return new EloquentExchangeRegistry(); |
35 | 35 | }); |
36 | 36 | |
37 | - $this->app->singleton('settings', function ($app) { |
|
37 | + $this->app->singleton('settings', function($app) { |
|
38 | 38 | return Settings::firstOrNew([]); |
39 | 39 | }); |
40 | 40 | } |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | public function create($id) |
35 | 35 | { |
36 | 36 | try { |
37 | - $data = DB::transaction(function () use ($id) { |
|
37 | + $data = DB::transaction(function() use ($id) { |
|
38 | 38 | $enrollment = Auth::student()->enrollments()->findOrFail($id); |
39 | 39 | |
40 | - if (! $enrollment->availableForExchange()) { |
|
40 | + if ( ! $enrollment->availableForExchange()) { |
|
41 | 41 | throw new \LogicException('The enrollment is not available for exchange.'); |
42 | 42 | } |
43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return compact('enrollment', 'matchingEnrollments'); |
49 | 49 | }); |
50 | 50 | |
51 | - $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) { |
|
51 | + $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) { |
|
52 | 52 | return [ |
53 | 53 | 'id' => $item->id, |
54 | 54 | '_toString' => $item->present()->inlineToString(), |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function store($id, CreateRequest $request) |
75 | 75 | { |
76 | 76 | try { |
77 | - $exchange = DB::transaction(function () use ($id, $request) { |
|
77 | + $exchange = DB::transaction(function() use ($id, $request) { |
|
78 | 78 | $this->validate($request, [ |
79 | 79 | 'to_enrollment_id' => 'exists:enrollments,id', |
80 | 80 | ]); |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | */ |
36 | 36 | protected function adminDashboard() |
37 | 37 | { |
38 | - $courses = DB::transaction(function () { |
|
38 | + $courses = DB::transaction(function() { |
|
39 | 39 | return Course::withCount('enrollments') |
40 | 40 | ->orderedList() |
41 | 41 | ->get(); |
42 | 42 | }); |
43 | 43 | |
44 | - $courses = $courses->groupBy(function ($course) { |
|
44 | + $courses = $courses->groupBy(function($course) { |
|
45 | 45 | return $course->present()->getOrdinalYear(); |
46 | 46 | }); |
47 | 47 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function studentDashboard() |
57 | 57 | { |
58 | - $data = DB::transaction(function () { |
|
58 | + $data = DB::transaction(function() { |
|
59 | 59 | $data['enrollments'] = Auth::student()->enrollments() |
60 | 60 | ->withCount('exchangesAsSource') |
61 | 61 | ->orderByCourse() |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | // Group all enrollments by the year of their associated course, so |
70 | 70 | // the enrollments listing is organized by year. This will allow |
71 | 71 | // a better experience, since it matches the official order. |
72 | - $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) { |
|
72 | + $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) { |
|
73 | 73 | return $enrollment->course->present()->getOrdinalYear(); |
74 | 74 | }); |
75 | 75 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function confirm($id) |
33 | 33 | { |
34 | - $exchange = DB::transaction(function () use ($id) { |
|
34 | + $exchange = DB::transaction(function() use ($id) { |
|
35 | 35 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
36 | 36 | |
37 | 37 | return $exchange->perform(); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function decline($id) |
54 | 54 | { |
55 | - $exchange = DB::transaction(function () use ($id) { |
|
55 | + $exchange = DB::transaction(function() use ($id) { |
|
56 | 56 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
57 | 57 | $exchange->delete(); |
58 | 58 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function destroy($id) |
76 | 76 | { |
77 | - DB::transaction(function () use ($id) { |
|
77 | + DB::transaction(function() use ($id) { |
|
78 | 78 | Auth::student()->requestedExchanges()->findOrFail($id)->delete(); |
79 | 79 | }); |
80 | 80 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | public function store($id) |
31 | 31 | { |
32 | 32 | try { |
33 | - $course = DB::transaction(function () use ($id) { |
|
33 | + $course = DB::transaction(function() use ($id) { |
|
34 | 34 | $course = Course::findOrFail($id); |
35 | 35 | Auth::student()->enroll($course); |
36 | 36 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function destroy($id) |
57 | 57 | { |
58 | - $course = DB::transaction(function () use ($id) { |
|
58 | + $course = DB::transaction(function() use ($id) { |
|
59 | 59 | $course = Course::findOrFail($id); |
60 | 60 | Auth::student()->unenroll($course); |
61 | 61 |