@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function index() |
| 27 | 27 | { |
| 28 | - $courses = DB::transaction(function () { |
|
| 28 | + $courses = DB::transaction(function() { |
|
| 29 | 29 | return Course::orderedList()->get(); |
| 30 | 30 | }); |
| 31 | 31 | |
| 32 | - $courses = $courses->groupBy(function ($course) { |
|
| 32 | + $courses = $courses->groupBy(function($course) { |
|
| 33 | 33 | return $course->present()->getOrdinalYear(); |
| 34 | 34 | }); |
| 35 | 35 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function show($courseId) |
| 47 | 47 | { |
| 48 | - $groups = DB::transaction(function () use ($courseId) { |
|
| 48 | + $groups = DB::transaction(function() use ($courseId) { |
|
| 49 | 49 | return Group::with('memberships.student.user')->whereCourseId($courseId)->get(); |
| 50 | 50 | }); |
| 51 | 51 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ->get(); |
| 39 | 39 | |
| 40 | 40 | foreach ($enrollments as $enrollmentKey => $enrollment) { |
| 41 | - $course = DB::transaction(function () use ($enrollment) { |
|
| 41 | + $course = DB::transaction(function() use ($enrollment) { |
|
| 42 | 42 | return Course::whereId($enrollment->course_id)->first(); |
| 43 | 43 | }); |
| 44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if (is_null($membership)) { |
| 53 | 53 | $enrollment->group_status = 0; |
| 54 | 54 | } else { |
| 55 | - $group = DB::transaction(function () use ($membership) { |
|
| 55 | + $group = DB::transaction(function() use ($membership) { |
|
| 56 | 56 | return Group::with('memberships') |
| 57 | 57 | ->whereId($membership->group_id) |
| 58 | 58 | ->first(); |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function store($courseId) |
| 85 | 85 | { |
| 86 | - $group = DB::transaction(function () use ($courseId) { |
|
| 87 | - if (! Course::find($courseId)->exists()) { |
|
| 86 | + $group = DB::transaction(function() use ($courseId) { |
|
| 87 | + if ( ! Course::find($courseId)->exists()) { |
|
| 88 | 88 | return redirect()->back(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $student = Auth::student(); |
| 120 | 120 | |
| 121 | - $course = DB::transaction(function () use ($courseId, $student) { |
|
| 121 | + $course = DB::transaction(function() use ($courseId, $student) { |
|
| 122 | 122 | $course = Course::whereId($courseId)->first(); |
| 123 | 123 | |
| 124 | 124 | $course->number_invitations = Invitation::ofStudentInCourse( |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | return $course; |
| 130 | 130 | }); |
| 131 | 131 | |
| 132 | - $membership = DB::transaction(function () use ($courseId, $student) { |
|
| 132 | + $membership = DB::transaction(function() use ($courseId, $student) { |
|
| 133 | 133 | return $student->memberships() |
| 134 | 134 | ->with('group.memberships.student.user') |
| 135 | 135 | ->whereCourseId($courseId) |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function update($inviteId) |
| 150 | 150 | { |
| 151 | - $invitation = DB::transaction(function () use ($inviteId) { |
|
| 151 | + $invitation = DB::transaction(function() use ($inviteId) { |
|
| 152 | 152 | return Invitation::with(['group.memberships', 'group.course']) |
| 153 | 153 | ->whereId($inviteId) |
| 154 | 154 | ->first(); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | Auth::student()->leave($group); |
| 197 | 197 | |
| 198 | - if (! $group->memberships()->count()) { |
|
| 198 | + if ( ! $group->memberships()->count()) { |
|
| 199 | 199 | $invitations = Invitation::whereGroupId($group->id)->get(); |
| 200 | 200 | |
| 201 | 201 | foreach ($invitations as $invitation) { |
@@ -22,15 +22,15 @@ discard block |
||
| 22 | 22 | URL::forceScheme('https'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - Auth::macro('student', function () { |
|
| 25 | + Auth::macro('student', function() { |
|
| 26 | 26 | return Auth::check() ? Auth::user()->student : null; |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | - Validator::extend('student_number', function ($attribute, $value, $parameters, $validator) { |
|
| 29 | + Validator::extend('student_number', function($attribute, $value, $parameters, $validator) { |
|
| 30 | 30 | return preg_match('/^(a|pg)[0-9]+$/i', $value) === 1; |
| 31 | 31 | }); |
| 32 | 32 | |
| 33 | - Validator::extend('greater_than_field', function ($attribute, $value, $parameters, $validator) { |
|
| 33 | + Validator::extend('greater_than_field', function($attribute, $value, $parameters, $validator) { |
|
| 34 | 34 | $min_field = $parameters[0]; |
| 35 | 35 | $data = $validator->getData(); |
| 36 | 36 | $min_value = $data[$min_field]; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return $value > $min_value; |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - Validator::replacer('greater_than_field', function ($message, $attribute, $rule, $parameters) { |
|
| 41 | + Validator::replacer('greater_than_field', function($message, $attribute, $rule, $parameters) { |
|
| 42 | 42 | return str_replace(':field', $parameters[0], $message); |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function register() |
| 50 | 50 | { |
| 51 | - $this->app->singleton(ExchangeRegistry::class, function ($app) { |
|
| 51 | + $this->app->singleton(ExchangeRegistry::class, function($app) { |
|
| 52 | 52 | return new EloquentExchangeRegistry(); |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | - $this->app->singleton('settings', function ($app) { |
|
| 55 | + $this->app->singleton('settings', function($app) { |
|
| 56 | 56 | return Settings::firstOrNew([]); |
| 57 | 57 | }); |
| 58 | 58 | } |