@@ -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 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function boot() |
| 17 | 17 | { |
| 18 | - Validator::extend('student_number', function ($attribute, $value, $parameters, $validator) { |
|
| 18 | + Validator::extend('student_number', function($attribute, $value, $parameters, $validator) { |
|
| 19 | 19 | return preg_match('/^(a|pg)[0-9]+$/', $value) === 1; |
| 20 | 20 | }); |
| 21 | 21 | } |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function register() |
| 27 | 27 | { |
| 28 | - $this->app->singleton(ExchangeRegistry::class, function ($app) { |
|
| 28 | + $this->app->singleton(ExchangeRegistry::class, function($app) { |
|
| 29 | 29 | return new EloquentExchangeRegistry(); |
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | - $this->app->singleton('settings', function ($app) { |
|
| 32 | + $this->app->singleton('settings', function($app) { |
|
| 33 | 33 | return Settings::firstOrNew([]); |
| 34 | 34 | }); |
| 35 | 35 | } |
@@ -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 |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function store(CreateRequest $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 | ]); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function destroy(DestroyRequest $request) |
| 61 | 61 | { |
| 62 | - $course = DB::transaction(function () use ($request) { |
|
| 62 | + $course = DB::transaction(function() use ($request) { |
|
| 63 | 63 | $this->validate($request, [ |
| 64 | 64 | 'course_id' => 'exists:courses,id', |
| 65 | 65 | ]); |
@@ -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::ownedBy(auth()->user()->student) |
| 39 | 39 | ->findOrFail($enrollmentId); |
| 40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return compact('enrollment', 'matchingEnrollments'); |
| 52 | 52 | }); |
| 53 | 53 | |
| 54 | - $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function ($item) { |
|
| 54 | + $data['matchingEnrollments'] = $data['matchingEnrollments']->map(function($item) { |
|
| 55 | 55 | return [ |
| 56 | 56 | 'id' => $item->id, |
| 57 | 57 | '_toString' => $item->present()->inlineToString(), |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function store(CreateRequest $request) |
| 77 | 77 | { |
| 78 | 78 | try { |
| 79 | - DB::transaction(function () use ($request) { |
|
| 79 | + DB::transaction(function() use ($request) { |
|
| 80 | 80 | $this->validate($request, [ |
| 81 | 81 | 'from_enrollment_id' => 'exists:enrollments,id', |
| 82 | 82 | 'to_enrollment_id' => 'exists:enrollments,id', |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | // already exists. If the inverse record is found then we will |
| 91 | 91 | // exchange and update both enrollments of this exchange. |
| 92 | 92 | $exchange = Exchange::findMatchingExchange($fromEnrollment, $toEnrollment); |
| 93 | - if (! is_null($exchange)) { |
|
| 93 | + if ( ! is_null($exchange)) { |
|
| 94 | 94 | return $exchange->perform(); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function storeConfirmation(Request $request) |
| 125 | 125 | { |
| 126 | - $exchange = DB::transaction(function () use ($request) { |
|
| 126 | + $exchange = DB::transaction(function() use ($request) { |
|
| 127 | 127 | $this->validate($request, [ |
| 128 | 128 | 'exchange_id' => 'exists:exchanges,id', |
| 129 | 129 | ]); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function storeDecline(Request $request) |
| 152 | 152 | { |
| 153 | - $exchange = DB::transaction(function () use ($request) { |
|
| 153 | + $exchange = DB::transaction(function() use ($request) { |
|
| 154 | 154 | $this->validate($request, [ |
| 155 | 155 | 'exchange_id' => 'exists:exchanges,id', |
| 156 | 156 | ]); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function destroy(Request $request) |
| 181 | 181 | { |
| 182 | - DB::transaction(function () use ($request) { |
|
| 182 | + DB::transaction(function() use ($request) { |
|
| 183 | 183 | $this->validate($request, [ |
| 184 | 184 | 'exchange_id' => 'exists:exchanges,id', |
| 185 | 185 | ]); |