Passed
Push — master ( 952446...f0a3f9 )
by Thomas
07:48 queued 11s
created
app/Models/Period.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -208,8 +208,8 @@
 block discarded – undo
208 208
                 foreach ($course->enrollments as $enrollment) {
209 209
                     // if a student has no attendance record for the class (event)
210 210
                     $hasNotAttended = $course->attendance->where('student_id', $enrollment->student_id)
211
-                     ->where('event_id', $event->id)
212
-                     ->isEmpty();
211
+                        ->where('event_id', $event->id)
212
+                        ->isEmpty();
213 213
 
214 214
                     // count one and break loop
215 215
                     if ($hasNotAttended) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     {
25 25
         parent::boot();
26 26
 
27
-        static::addGlobalScope('order', function (Builder $builder) {
27
+        static::addGlobalScope('order', function(Builder $builder) {
28 28
             $builder->orderBy('year_id')->orderBy('order')->orderBy('id');
29 29
         });
30 30
     }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 ->where('courses.period_id', $this->id)
155 155
                 ->where('enrollments.deleted_at', null)
156 156
                 ->where('enrollments.parent_id', null)
157
-                ->where(function ($query) {
157
+                ->where(function($query) {
158 158
                     return $query->where('students.gender_id', 0)->orWhereNull('students.gender_id');
159 159
                 })
160 160
                 ->whereIn('enrollments.status_id', ['1', '2']) // filter out cancelled enrollments, todo make this configurable.
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $period = self::where('id', '<', $this->id)->orderBy('id', 'desc')->first();
203 203
 
204
-        if (! $period == null) {
204
+        if (!$period == null) {
205 205
             return $period;
206 206
         } else {
207 207
             return self::first();
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     public function getCoursesWithPendingAttendanceAttribute()
282 282
     {
283 283
         // get all courses for period and preload relations
284
-        $courses = $this->courses()->where(function ($query) {
284
+        $courses = $this->courses()->where(function($query) {
285 285
             $query->where('exempt_attendance', '!=', true);
286 286
             $query->where('exempt_attendance', '!=', 1);
287 287
             $query->orWhereNull('exempt_attendance');
Please login to merge, or discard this patch.
app/Models/Leave.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
         parent::boot();
21 21
 
22 22
         // do not save already existing leaves
23
-        static::saving(function (self $leave) {
23
+        static::saving(function(self $leave) {
24 24
             if (self::where('teacher_id', $leave->teacher_id)->where('date', $leave->date)->count() > 0) {
25 25
                 return false;
26 26
             }
27 27
         });
28 28
 
29 29
         // when a leave is, we detach the events from the teacher
30
-        static::saved(function (self $leave) {
30
+        static::saved(function(self $leave) {
31 31
             $events = Event::where('teacher_id', $leave->teacher_id)->whereDate('start', $leave->date)->get();
32 32
             foreach ($events as $event) {
33 33
                 $event->teacher_id = null;
Please login to merge, or discard this patch.
app/Models/CourseTime.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
         parent::boot();
16 16
 
17 17
         // when a coursetime is added, we should create corresponding events
18
-        static::created(function ($coursetime) {
18
+        static::created(function($coursetime) {
19 19
             $coursetime->create_events();
20 20
         });
21 21
 
22 22
         // when a coursetime is deleted, we should delete all associated future events
23
-        static::deleted(function ($coursetime) {
23
+        static::deleted(function($coursetime) {
24 24
             $coursetime->events()->delete();
25 25
             // todo delete only future events
26 26
         });
Please login to merge, or discard this patch.
app/Http/Middleware/CheckIfAdmin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             return $this->respondToUnauthorizedRequest($request);
57 57
         }
58 58
 
59
-        if (! $this->checkIfUserIsAdmin(backpack_user())) {
59
+        if (!$this->checkIfUserIsAdmin(backpack_user())) {
60 60
             return $this->respondToUnauthorizedRequest($request);
61 61
         }
62 62
 
Please login to merge, or discard this patch.
app/Http/Middleware/PermissionMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             return redirect()->to('login');
20 20
         }
21 21
 
22
-        if (! backpack_user()->can($permission)) {
22
+        if (!backpack_user()->can($permission)) {
23 23
             abort(403);
24 24
         }
25 25
 
Please login to merge, or discard this patch.
app/Http/Middleware/RoleMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             return redirect('/login');
20 20
         }
21 21
 
22
-        if (! backpack_auth()->user()->hasRole($role)) {
22
+        if (!backpack_auth()->user()->hasRole($role)) {
23 23
             abort(403);
24 24
         }
25 25
 
Please login to merge, or discard this patch.
app/Http/Middleware/Authenticate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     protected function redirectTo($request)
16 16
     {
17
-        if (! $request->expectsJson()) {
17
+        if (!$request->expectsJson()) {
18 18
             return route('login');
19 19
         }
20 20
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     {
18 18
 
19 19
         // Check if is allowed and set default locale if not
20
-        if (! language()->allowed($locale)) {
20
+        if (!language()->allowed($locale)) {
21 21
             $locale = config('app.locale');
22 22
         }
23 23
 
Please login to merge, or discard this patch.
app/Http/Controllers/ContactController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function update(Contact $contact, Request $request)
58 58
     {
59 59
         // check if the user is allowed to edit the contact
60
-        if (! backpack_user()->can('update', $contact)) {
60
+        if (!backpack_user()->can('update', $contact)) {
61 61
             abort(403);
62 62
         }
63 63
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     public function edit(Contact $contact)
96 96
     {
97 97
         // check if the user is allowed to edit the contact
98
-        if (! backpack_user()->can('update', $contact)) {
98
+        if (!backpack_user()->can('update', $contact)) {
99 99
             abort(403);
100 100
         }
101 101
 
Please login to merge, or discard this patch.