@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function show($id) |
28 | 28 | { |
29 | - $data = DB::transaction(function () use ($id) { |
|
29 | + $data = DB::transaction(function() use ($id) { |
|
30 | 30 | $course = Course::findOrFail($id); |
31 | 31 | $enrollments = $course->enrollments() |
32 | 32 | ->with('student.user') |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function export() |
33 | 33 | { |
34 | 34 | // Get the list of students enrolled on each course |
35 | - $enrollments = DB::transaction(function () { |
|
35 | + $enrollments = DB::transaction(function() { |
|
36 | 36 | $enrollments = Enrollment::with('student', 'course') |
37 | 37 | ->get() |
38 | 38 | ->sortByDesc('courses.name'); |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | }); |
42 | 42 | |
43 | 43 | // Export to CSV |
44 | - $result = Excel::create('enrollments', function ($excel) use ($enrollments) { |
|
45 | - $excel->sheet('Enrollments', function ($sheet) use ($enrollments) { |
|
44 | + $result = Excel::create('enrollments', function($excel) use ($enrollments) { |
|
45 | + $excel->sheet('Enrollments', function($sheet) use ($enrollments) { |
|
46 | 46 | $sheet->loadView('enrollments.export', compact('enrollments')); |
47 | 47 | }); |
48 | 48 | }); |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | $file = $request->enrollments; |
64 | 64 | $path = $file->path(); |
65 | 65 | |
66 | - Excel::load($path, function ($reader) { |
|
67 | - DB::transaction(function () use ($reader) { |
|
66 | + Excel::load($path, function($reader) { |
|
67 | + DB::transaction(function() use ($reader) { |
|
68 | 68 | // Loop for all the rows of the table |
69 | - $reader->each(function ($row, $index) { |
|
69 | + $reader->each(function($row, $index) { |
|
70 | 70 | $index += 2; // Skip header |
71 | 71 | |
72 | 72 | // Get the models of the given ids |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function update(UpdateRequest $request) |
39 | 39 | { |
40 | - DB::transaction(function () use ($request) { |
|
40 | + DB::transaction(function() use ($request) { |
|
41 | 41 | app('settings')->update($request->all()); |
42 | 42 | }); |
43 | 43 | flash('Settings were successfully updated.')->success(); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function show($id, ExchangeRegistry $exchangeLogger) |
20 | 20 | { |
21 | - $data = DB::transaction(function () use ($id, $exchangeLogger) { |
|
21 | + $data = DB::transaction(function() use ($id, $exchangeLogger) { |
|
22 | 22 | $data = []; |
23 | 23 | $student = Student::findOrFail($id); |
24 | 24 | $data['student'] = $student; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // Group all enrollments by the year of their associated course, so |
38 | 38 | // the enrollments listing is organized by year. This will allow |
39 | 39 | // a better experience, since it matches the official order. |
40 | - $data['enrollments'] = $data['enrollments']->groupBy(function ($enrollment) { |
|
40 | + $data['enrollments'] = $data['enrollments']->groupBy(function($enrollment) { |
|
41 | 41 | return $enrollment->course->present()->getOrdinalYear(); |
42 | 42 | }); |
43 | 43 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function store($id) |
33 | 33 | { |
34 | 34 | try { |
35 | - $course = DB::transaction(function () use ($id) { |
|
35 | + $course = DB::transaction(function() use ($id) { |
|
36 | 36 | $course = Course::findOrFail($id); |
37 | 37 | Auth::student()->enroll($course); |
38 | 38 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function destroy($id) |
57 | 57 | { |
58 | 58 | try { |
59 | - $course = DB::transaction(function () use ($id) { |
|
59 | + $course = DB::transaction(function() use ($id) { |
|
60 | 60 | $course = Course::findOrFail($id); |
61 | 61 | Auth::student()->unenroll($course); |
62 | 62 |
@@ -140,7 +140,7 @@ |
||
140 | 140 | throw new StudentIsNotEnrolledInCourseException($course); |
141 | 141 | } |
142 | 142 | |
143 | - if (! $enrollment->isDeletable()) { |
|
143 | + if ( ! $enrollment->isDeletable()) { |
|
144 | 144 | throw new EnrollmentCannotBeDeleted($enrollment); |
145 | 145 | } |
146 | 146 |
@@ -72,11 +72,11 @@ |
||
72 | 72 | */ |
73 | 73 | public function setExchangeEnrollments(Enrollment $from, Enrollment $to) : self |
74 | 74 | { |
75 | - if (! $from->availableForExchange() || is_null($to->shift)) { |
|
75 | + if ( ! $from->availableForExchange() || is_null($to->shift)) { |
|
76 | 76 | throw new EnrollmentCannotBeExchangedException(); |
77 | 77 | } |
78 | 78 | |
79 | - if (! $from->course->is($to->course)) { |
|
79 | + if ( ! $from->course->is($to->course)) { |
|
80 | 80 | throw new ExchangeEnrollmentsOnDifferentCoursesException(); |
81 | 81 | } |
82 | 82 |
@@ -39,9 +39,9 @@ |
||
39 | 39 | */ |
40 | 40 | public function handle() |
41 | 41 | { |
42 | - DB::transaction(function () { |
|
42 | + DB::transaction(function() { |
|
43 | 43 | $students = Student::with('user')->get(); |
44 | - $students->each(function ($student) { |
|
44 | + $students->each(function($student) { |
|
45 | 45 | $user = $student->user; |
46 | 46 | if ($user->verified) { |
47 | 47 | return; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function validator(array $data) |
50 | 50 | { |
51 | - if (! is_null($data['student_number'])) { |
|
51 | + if ( ! is_null($data['student_number'])) { |
|
52 | 52 | $data['student_number'] = strtolower($data['student_number']); |
53 | 53 | } |
54 | 54 | |
@@ -68,7 +68,7 @@ discard block |
||
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 | $data['student_number'] = strtolower($data['student_number']); |
73 | 73 | $user = User::make([ |
74 | 74 | 'name' => $data['name'], |