@@ -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 |
@@ -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 | }); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function boot() |
16 | 16 | { |
17 | - View::composer('*', function ($view) { |
|
17 | + View::composer('*', function($view) { |
|
18 | 18 | $view->with('settings', app('settings')); |
19 | 19 | }); |
20 | 20 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | public function show($id) |
18 | 18 | { |
19 | - $data = DB::transaction(function () use ($id) { |
|
19 | + $data = DB::transaction(function() use ($id) { |
|
20 | 20 | $data = []; |
21 | 21 | $data['course'] = Course::findOrFail($id); |
22 | 22 | $data['enrollments'] = $data['course']->enrollments() |
@@ -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['student_number'].'@alunos.uminho.pt', |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function index(ExchangeRegistry $exchangeLogger) |
17 | 17 | { |
18 | - $history = DB::transaction(function () use ($exchangeLogger) { |
|
18 | + $history = DB::transaction(function() use ($exchangeLogger) { |
|
19 | 19 | return $exchangeLogger->paginate(); |
20 | 20 | }); |
21 | 21 |
@@ -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,10 +54,10 @@ discard block |
||
54 | 54 | $file = $request->enrollments; |
55 | 55 | $path = $file->path(); |
56 | 56 | |
57 | - Excel::load($path, function ($reader) { |
|
58 | - DB::transaction(function () use ($reader) { |
|
57 | + Excel::load($path, function($reader) { |
|
58 | + DB::transaction(function() use ($reader) { |
|
59 | 59 | // Loop for all the rows of the table |
60 | - $reader->each(function ($row, $index) { |
|
60 | + $reader->each(function($row, $index) { |
|
61 | 61 | $index += 2; // Skip header |
62 | 62 | |
63 | 63 | // Get the models of the given ids |
@@ -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 |
@@ -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 |