@@ -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 | |
@@ -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_or_equal_than_field', function ($attribute, $value, $parameters, $validator) { |
|
| 33 | + Validator::extend('greater_or_equal_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_or_equal_than_field', function ($message, $attribute, $rule, $parameters) { |
|
| 41 | + Validator::replacer('greater_or_equal_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 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | */ |
| 59 | 59 | public static function create($studentNumber, $groupId, $courseId) |
| 60 | 60 | { |
| 61 | - $exception = DB::transaction(function () use ($studentNumber, $groupId) { |
|
| 61 | + $exception = DB::transaction(function() use ($studentNumber, $groupId) { |
|
| 62 | 62 | $findAnyInvitation = self::where([ |
| 63 | 63 | ['student_number', $studentNumber], |
| 64 | 64 | ['group_id', $groupId], |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | throw new StudentIsNotEnrolledInCourseException($course); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if (! $enrollment->isDeletable()) { |
|
| 145 | + if ( ! $enrollment->isDeletable()) { |
|
| 146 | 146 | throw new EnrollmentCannotBeDeleted($enrollment); |
| 147 | 147 | } |
| 148 | 148 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function join(Group $group): Membership |
| 185 | 185 | { |
| 186 | - $exception = DB::transaction(function () use ($group) { |
|
| 186 | + $exception = DB::transaction(function() use ($group) { |
|
| 187 | 187 | if ($this->isMemberOfGroupInCourse($group->course_id)) { |
| 188 | 188 | return new UserHasAlreadyGroupInCourseException(Course::find($group->course_id)); |
| 189 | 189 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function index() |
| 32 | 32 | { |
| 33 | - $enrollments = DB::transaction(function () { |
|
| 33 | + $enrollments = DB::transaction(function() { |
|
| 34 | 34 | $student = Auth::student(); |
| 35 | 35 | |
| 36 | 36 | $enrollments = $student |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function store($courseId) |
| 57 | 57 | { |
| 58 | - $group = DB::transaction(function () use ($courseId) { |
|
| 58 | + $group = DB::transaction(function() use ($courseId) { |
|
| 59 | 59 | $course = Course::findOrFail($courseId); |
| 60 | 60 | |
| 61 | 61 | $group = new Group(); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $student = Auth::student(); |
| 94 | 94 | |
| 95 | - $course = DB::transaction(function () use ($courseId, $student) { |
|
| 95 | + $course = DB::transaction(function() use ($courseId, $student) { |
|
| 96 | 96 | $course = Course::whereId($courseId)->first(); |
| 97 | 97 | |
| 98 | 98 | $course->number_invitations = Invitation::ofStudentInCourse( |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | return $course; |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | - $membership = DB::transaction(function () use ($courseId, $student) { |
|
| 106 | + $membership = DB::transaction(function() use ($courseId, $student) { |
|
| 107 | 107 | return $student->memberships() |
| 108 | 108 | ->with('group.memberships.student.user') |
| 109 | 109 | ->whereCourseId($courseId) |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | Auth::student()->leave($group); |
| 130 | 130 | |
| 131 | - if (! $group->memberships()->count()) { |
|
| 131 | + if ( ! $group->memberships()->count()) { |
|
| 132 | 132 | $invitations = Invitation::whereGroupId($group->id)->get(); |
| 133 | 133 | |
| 134 | 134 | foreach ($invitations as $invitation) { |
@@ -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], |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function update($inviteId) |
| 81 | 81 | { |
| 82 | - $invitation = DB::transaction(function () use ($inviteId) { |
|
| 82 | + $invitation = DB::transaction(function() use ($inviteId) { |
|
| 83 | 83 | return Invitation::with(['group.memberships', 'group.course']) |
| 84 | 84 | ->whereId($inviteId) |
| 85 | 85 | ->whereStudentNumber(Auth::student()->student_number) |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $courseId = 0; |
| 131 | 131 | |
| 132 | - $remainingInvitations = DB::transaction(function () use ($id, &$courseId) { |
|
| 132 | + $remainingInvitations = DB::transaction(function() use ($id, &$courseId) { |
|
| 133 | 133 | $invitation = Invitation::find($id) |
| 134 | 134 | ->whereStudentNumber(Auth::student()->student_number) |
| 135 | 135 | ->first(); |