@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function handle($request, Closure $next) |
| 18 | 18 | { |
| 19 | - if (! app('settings')->withinGroupCreationPeriod()) { |
|
| 19 | + if ( ! app('settings')->withinGroupCreationPeriod()) { |
|
| 20 | 20 | flash('The group creation period is closed. You are not allowed to perform this action.')->error(); |
| 21 | 21 | |
| 22 | 22 | return redirect()->route('dashboard'); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function show($id) |
| 29 | 29 | { |
| 30 | - $data = DB::transaction(function () use ($id) { |
|
| 30 | + $data = DB::transaction(function() use ($id) { |
|
| 31 | 31 | $course = Course::findOrFail($id); |
| 32 | 32 | $enrollments = $course->enrollments() |
| 33 | 33 | ->with('student.user') |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function update(UpdateRequest $request, $id) |
| 52 | 52 | { |
| 53 | - DB::transaction(function () use ($request, $id) { |
|
| 53 | + DB::transaction(function() use ($request, $id) { |
|
| 54 | 54 | $course = Course::findOrFail($id); |
| 55 | 55 | |
| 56 | 56 | $course->fill($request->all()); |
@@ -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 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function create($studentNumber, $groupId, $courseId) |
| 58 | 58 | { |
| 59 | - $invitation = DB::transaction(function () use ($studentNumber, $courseId) { |
|
| 59 | + $invitation = DB::transaction(function() use ($studentNumber, $courseId) { |
|
| 60 | 60 | return Invitation::where([ |
| 61 | 61 | ['student_number', $studentNumber], |
| 62 | 62 | ['course_id', $courseId], |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function index($courseId) |
| 31 | 31 | { |
| 32 | - $invitations = DB::transaction(function () use ($courseId) { |
|
| 32 | + $invitations = DB::transaction(function() use ($courseId) { |
|
| 33 | 33 | return Invitation::with('group.memberships.student.user') |
| 34 | 34 | ->where([ |
| 35 | 35 | ['student_number', Auth::student()->student_number], |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $courseId = 0; |
| 88 | 88 | |
| 89 | - $remainingInvitations = DB::transaction(function () use ($id, &$courseId) { |
|
| 89 | + $remainingInvitations = DB::transaction(function() use ($id, &$courseId) { |
|
| 90 | 90 | $invitation = Invitation::whereId($id)->first(); |
| 91 | 91 | |
| 92 | 92 | $courseId = $invitation->course_id; |