@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function index(ExchangeRegistry $registry) |
| 26 | 26 | { |
| 27 | - $history = DB::transaction(function () use ($registry) { |
|
| 27 | + $history = DB::transaction(function() use ($registry) { |
|
| 28 | 28 | return $registry->paginate(); |
| 29 | 29 | }); |
| 30 | 30 | |
@@ -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(); |
@@ -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 | |
@@ -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 | 'enrollment_id' => 'exists:enrollments,id', |
| 80 | 80 | ]); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function confirm($id) |
| 35 | 35 | { |
| 36 | - $exchange = DB::transaction(function () use ($id) { |
|
| 36 | + $exchange = DB::transaction(function() use ($id) { |
|
| 37 | 37 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
| 38 | 38 | |
| 39 | 39 | return $exchange->perform(); |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | try { |
| 57 | 57 | $id = $request->input('enrollment_id'); |
| 58 | - $data = DB::transaction(function () use ($id) { |
|
| 58 | + $data = DB::transaction(function() use ($id) { |
|
| 59 | 59 | $enrollment = Auth::student()->enrollments()->findOrFail($id); |
| 60 | 60 | |
| 61 | - if (! $enrollment->availableForExchange()) { |
|
| 61 | + if ( ! $enrollment->availableForExchange()) { |
|
| 62 | 62 | throw new \LogicException('The enrollment is not available for exchange.'); |
| 63 | 63 | } |
| 64 | 64 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | return compact('enrollment', 'matchingEnrollments', 'shiftsAvailable'); |
| 80 | 80 | }); |
| 81 | 81 | |
| 82 | - $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) { |
|
| 82 | + $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) { |
|
| 83 | 83 | return [ |
| 84 | 84 | 'id' => $item->id, |
| 85 | 85 | '_toString' => $item->present()->inlineToString(), |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function decline($id) |
| 105 | 105 | { |
| 106 | - $exchange = DB::transaction(function () use ($id) { |
|
| 106 | + $exchange = DB::transaction(function() use ($id) { |
|
| 107 | 107 | $exchange = Auth::student()->proposedExchanges()->findOrFail($id); |
| 108 | 108 | $exchange->delete(); |
| 109 | 109 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function destroy($id) |
| 126 | 126 | { |
| 127 | - DB::transaction(function () use ($id) { |
|
| 127 | + DB::transaction(function() use ($id) { |
|
| 128 | 128 | Auth::student()->requestedExchanges()->findOrFail($id)->delete(); |
| 129 | 129 | }); |
| 130 | 130 | flash('The shift exchange request was successfully deleted.')->success(); |