@@ -26,8 +26,8 @@ |
||
26 | 26 | public function scopeOrderedList($query) |
27 | 27 | { |
28 | 28 | return $query->orderBy('year', 'asc') |
29 | - ->orderBy('semester', 'asc') |
|
30 | - ->orderBy('name', 'asc'); |
|
29 | + ->orderBy('semester', 'asc') |
|
30 | + ->orderBy('name', 'asc'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function handle($request, Closure $next, $guard = null) |
19 | 19 | { |
20 | - if (! Auth::user()->verified) { |
|
20 | + if ( ! Auth::user()->verified) { |
|
21 | 21 | return response(view('auth.unconfirmed'), 403); |
22 | 22 | } |
23 | 23 |
@@ -14,11 +14,11 @@ |
||
14 | 14 | */ |
15 | 15 | public function index() |
16 | 16 | { |
17 | - $courses = DB::transaction(function () { |
|
17 | + $courses = DB::transaction(function() { |
|
18 | 18 | return Course::orderedList()->get(); |
19 | 19 | }); |
20 | 20 | |
21 | - $courses = $courses->groupBy(function ($course) { |
|
21 | + $courses = $courses->groupBy(function($course) { |
|
22 | 22 | return $course->present()->getOrdinalYear(); |
23 | 23 | }); |
24 | 24 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function store(Request $request) |
30 | 30 | { |
31 | 31 | try { |
32 | - $course = DB::transaction(function () use ($request) { |
|
32 | + $course = DB::transaction(function() use ($request) { |
|
33 | 33 | $this->validate($request, [ |
34 | 34 | 'course_id' => 'exists:courses,id', |
35 | 35 | ]); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function destroy(Request $request) |
60 | 60 | { |
61 | - $course = DB::transaction(function () use ($request) { |
|
61 | + $course = DB::transaction(function() use ($request) { |
|
62 | 62 | $this->validate($request, [ |
63 | 63 | 'course_id' => 'exists:courses,id', |
64 | 64 | ]); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | public function __construct() |
43 | 43 | { |
44 | 44 | $this->middleware('guest') |
45 | - ->except(['confirm', 'resendConfirmationEmail']); |
|
45 | + ->except(['confirm', 'resendConfirmationEmail']); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -68,7 +68,7 @@ |
||
68 | 68 | */ |
69 | 69 | protected function create(array $data) |
70 | 70 | { |
71 | - $user = DB::transaction(function () use ($data) { |
|
71 | + $user = DB::transaction(function() use ($data) { |
|
72 | 72 | $user = User::make([ |
73 | 73 | 'name' => $data['name'], |
74 | 74 | 'email' => $data['email'].'@alunos.uminho.pt', |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function create($enrollmentId) |
35 | 35 | { |
36 | 36 | try { |
37 | - $data = DB::transaction(function () use ($enrollmentId) { |
|
37 | + $data = DB::transaction(function() use ($enrollmentId) { |
|
38 | 38 | $enrollment = Enrollment::findOrFail($enrollmentId); |
39 | 39 | $this->authorize('exchange', $enrollment); |
40 | 40 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return compact('enrollment', 'matchingEnrollments'); |
50 | 50 | }); |
51 | 51 | |
52 | - $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) { |
|
52 | + $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) { |
|
53 | 53 | $newItem = []; |
54 | 54 | $newItem['id'] = $item->id; |
55 | 55 | $newItem['_toString'] = $item->present()->inlineToString(); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function store(CreateRequest $request) |
75 | 75 | { |
76 | 76 | try { |
77 | - $exchange = DB::transaction(function () use ($request) { |
|
77 | + $exchange = DB::transaction(function() use ($request) { |
|
78 | 78 | $this->validate($request, [ |
79 | 79 | 'from_enrollment_id' => 'exists:enrollments,id', |
80 | 80 | 'to_enrollment_id' => 'exists:enrollments,id', |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // already exists. If the inverse record is found then we will |
89 | 89 | // exchange and update both enrollments of this exchange. |
90 | 90 | $exchange = Exchange::findMatchingExchange($fromEnrollment, $toEnrollment); |
91 | - if (! is_null($exchange)) { |
|
91 | + if ( ! is_null($exchange)) { |
|
92 | 92 | return $exchange->perform(); |
93 | 93 | } |
94 | 94 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function storeConfirmation(Request $request) |
122 | 122 | { |
123 | - $exchange = DB::transaction(function () use ($request) { |
|
123 | + $exchange = DB::transaction(function() use ($request) { |
|
124 | 124 | $this->validate($request, [ |
125 | 125 | 'exchange_id' => 'exists:exchanges,id', |
126 | 126 | ]); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function storeDecline(Request $request) |
148 | 148 | { |
149 | - $exchange = DB::transaction(function () use ($request) { |
|
149 | + $exchange = DB::transaction(function() use ($request) { |
|
150 | 150 | $this->validate($request, [ |
151 | 151 | 'exchange_id' => 'exists:exchanges,id', |
152 | 152 | ]); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function destroy(Request $request) |
176 | 176 | { |
177 | - $exchange = DB::transaction(function () use ($request) { |
|
177 | + $exchange = DB::transaction(function() use ($request) { |
|
178 | 178 | $this->validate($request, [ |
179 | 179 | 'exchange_id' => 'exists:exchanges,id', |
180 | 180 | ]); |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function adminDashboard() |
39 | 39 | { |
40 | - $courses = DB::transaction(function () { |
|
40 | + $courses = DB::transaction(function() { |
|
41 | 41 | return Course::withCount('enrollments') |
42 | 42 | ->orderedList() |
43 | 43 | ->get(); |
44 | 44 | }); |
45 | 45 | |
46 | - $courses = $courses->groupBy(function ($course) { |
|
46 | + $courses = $courses->groupBy(function($course) { |
|
47 | 47 | return $course->present()->getOrdinalYear(); |
48 | 48 | }); |
49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | protected function studentDashboard() |
59 | 59 | { |
60 | - $data = DB::transaction(function () { |
|
60 | + $data = DB::transaction(function() { |
|
61 | 61 | $student = Auth::user()->student; |
62 | 62 | $data['enrollments'] = $student |
63 | 63 | ->enrollments() |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | // Group all enrollments by the year of their associated course, so |
74 | 74 | // the enrollments listing is organized by year. This will allow |
75 | 75 | // a better experience, since it matches the official order. |
76 | - $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) { |
|
76 | + $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) { |
|
77 | 77 | return $enrollment->course->present()->getOrdinalYear(); |
78 | 78 | }); |
79 | 79 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function update(UpdateRequest $request) |
29 | 29 | { |
30 | - DB::transaction(function () use ($request) { |
|
30 | + DB::transaction(function() use ($request) { |
|
31 | 31 | $settings = Settings::first(); |
32 | 32 | $settings->update($request->input()); |
33 | 33 | }); |
@@ -25,8 +25,8 @@ |
||
25 | 25 | // Get the list of students enrolled on each course |
26 | 26 | $enrollments = DB::transaction(function () { |
27 | 27 | $enrollments = Enrollment::with(['student', 'course']) |
28 | - ->get() |
|
29 | - ->sortByDesc('courses.name'); |
|
28 | + ->get() |
|
29 | + ->sortByDesc('courses.name'); |
|
30 | 30 | |
31 | 31 | return $enrollments; |
32 | 32 | }); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function export() |
24 | 24 | { |
25 | 25 | // Get the list of students enrolled on each course |
26 | - $enrollments = DB::transaction(function () { |
|
26 | + $enrollments = DB::transaction(function() { |
|
27 | 27 | $enrollments = Enrollment::with(['student', 'course']) |
28 | 28 | ->get() |
29 | 29 | ->sortByDesc('courses.name'); |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | }); |
33 | 33 | |
34 | 34 | // Export to CSV |
35 | - $result = Excel::create('enrollments', function ($excel) use ($enrollments) { |
|
36 | - $excel->sheet('Enrollments', function ($sheet) use ($enrollments) { |
|
35 | + $result = Excel::create('enrollments', function($excel) use ($enrollments) { |
|
36 | + $excel->sheet('Enrollments', function($sheet) use ($enrollments) { |
|
37 | 37 | $sheet->loadView('enrollments.export', compact('enrollments')); |
38 | 38 | }); |
39 | 39 | }); |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $path = $file->path(); |
55 | 55 | $filename = $file->getClientOriginalName(); |
56 | 56 | |
57 | - Excel::load($path, function ($reader) use ($filename) { |
|
58 | - DB::transaction(function () use ($filename, $reader) { |
|
57 | + Excel::load($path, function($reader) use ($filename) { |
|
58 | + DB::transaction(function() use ($filename, $reader) { |
|
59 | 59 | // Loop for all the rows of the table |
60 | 60 | $index = 1; |
61 | - $reader->each(function ($row) use (&$index) { |
|
61 | + $reader->each(function($row) use (&$index) { |
|
62 | 62 | // Calculate the row index |
63 | 63 | $index++; |
64 | 64 |