@@ -65,11 +65,11 @@ |
||
65 | 65 | */ |
66 | 66 | public function setExchangeEnrollments(Enrollment $from, Enrollment $to) : Exchange |
67 | 67 | { |
68 | - if (! $from->availableForExchange() || is_null($to->shift)) { |
|
68 | + if ( ! $from->availableForExchange() || is_null($to->shift)) { |
|
69 | 69 | throw new EnrollmentCannotBeExchangedException(); |
70 | 70 | } |
71 | 71 | |
72 | - if (! $from->course->is($to->course)) { |
|
72 | + if ( ! $from->course->is($to->course)) { |
|
73 | 73 | throw new ExchangeEnrollmentsOnDifferentCoursesException(); |
74 | 74 | } |
75 | 75 |
@@ -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'] = 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 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('student')) { |
|
3 | +if ( ! function_exists('student')) { |
|
4 | 4 | /** |
5 | 5 | * Get the authenticated student. |
6 | 6 | * |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public function handle($request, Closure $next) |
21 | 21 | { |
22 | - if (! Auth::user()->isStudent()) { |
|
22 | + if ( ! Auth::user()->isStudent()) { |
|
23 | 23 | abort(404); |
24 | 24 | } |
25 | 25 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public function handle($request, Closure $next) |
21 | 21 | { |
22 | - if (! Auth::user()->isAdmin()) { |
|
22 | + if ( ! Auth::user()->isAdmin()) { |
|
23 | 23 | abort(404); |
24 | 24 | } |
25 | 25 |
@@ -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 | 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 | student()->unenroll($course); |
61 | 61 |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | public function create($id) |
34 | 34 | { |
35 | 35 | try { |
36 | - $data = DB::transaction(function () use ($id) { |
|
36 | + $data = DB::transaction(function() use ($id) { |
|
37 | 37 | $enrollment = student()->enrollments()->findOrFail($id); |
38 | 38 | |
39 | - if (! $enrollment->availableForExchange()) { |
|
39 | + if ( ! $enrollment->availableForExchange()) { |
|
40 | 40 | throw new \LogicException('The enrollment is not available for exchange.'); |
41 | 41 | } |
42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return compact('enrollment', 'matchingEnrollments'); |
48 | 48 | }); |
49 | 49 | |
50 | - $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) { |
|
50 | + $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) { |
|
51 | 51 | return [ |
52 | 52 | 'id' => $item->id, |
53 | 53 | '_toString' => $item->present()->inlineToString(), |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function store($id, CreateRequest $request) |
74 | 74 | { |
75 | 75 | try { |
76 | - $exchange = DB::transaction(function () use ($id, $request) { |
|
76 | + $exchange = DB::transaction(function() use ($id, $request) { |
|
77 | 77 | $this->validate($request, [ |
78 | 78 | 'to_enrollment_id' => 'exists:enrollments,id', |
79 | 79 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function confirm($id) |
32 | 32 | { |
33 | - $exchange = DB::transaction(function () use ($id) { |
|
33 | + $exchange = DB::transaction(function() use ($id) { |
|
34 | 34 | $exchange = student()->proposedExchanges()->findOrFail($id); |
35 | 35 | |
36 | 36 | return $exchange->perform(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function decline($id) |
53 | 53 | { |
54 | - $exchange = DB::transaction(function () use ($id) { |
|
54 | + $exchange = DB::transaction(function() use ($id) { |
|
55 | 55 | $exchange = student()->proposedExchanges()->findOrFail($id); |
56 | 56 | $exchange->delete(); |
57 | 57 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function destroy($id) |
75 | 75 | { |
76 | - DB::transaction(function () use ($id) { |
|
76 | + DB::transaction(function() use ($id) { |
|
77 | 77 | student()->requestedExchanges()->findOrFail($id)->delete(); |
78 | 78 | }); |
79 | 79 |