Test Setup Failed
Branch master (86f4a4)
by Shawn
04:57
created
app/Http/Controllers/UserController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $this->authorize('view');
28 28
 
29 29
         $users = User::with([
30
-            'assignedTrainings' => function ($q) {
30
+            'assignedTrainings' => function($q) {
31 31
                 $q->whereNull('completed_date')
32 32
                     ->whereBetween('due_date', [Carbon::now()->subYear(), Carbon::now()->addWeeks(4)]);
33 33
             },
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $data['status'] = 'active';
61 61
         $user = User::create($data);
62 62
 
63
-        if( array_key_exists('groups', $data)) {
63
+        if (array_key_exists('groups', $data)) {
64 64
             settype($data['groups'], "array");
65 65
             $user->groups()->sync($data['groups']);
66 66
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function show($userId)
76 76
     {
77
-        $user = User::with(['subordinates' => function ($query) {
77
+        $user = User::with(['subordinates' => function($query) {
78 78
             $query->active();
79 79
         }, 'supervisor', 'groups', 'duties', 'attachments'])
80 80
             ->findOrFail($userId);
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
         $travels = $user->travels()->with('author', 'attachments')->get();
92 92
 
93 93
         $logs = [];
94
-        if(Gate::allows('view')) {
94
+        if (Gate::allows('view')) {
95 95
             $logs = $user->logs()->orderBy('created_at', 'desc')->get();
96 96
         }
97 97
 
98 98
         $this->previousAndNextUsers($user, $previous, $next);
99 99
 
100 100
         //This mess is just so that we can output the Security Check list or show none. Mainly just to show none.
101
-        $duties = Duty::whereHas('users', function ($q) use ($userId){
101
+        $duties = Duty::whereHas('users', function($q) use ($userId){
102 102
             $q->where('id', $userId);
103 103
         })->orWhereHas('groups.users', function($q) use ($userId) {
104 104
             $q->where('id', $userId);
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
         $user->update($data);
137 137
 
138 138
         //Handle user groups
139
-        if( !array_key_exists('groups', $data)) {
139
+        if (!array_key_exists('groups', $data)) {
140 140
             $data['groups'] = [];
141 141
         }
142 142
         $user->groups()->sync($data['groups']);
143 143
 
144 144
         //Handled closed area access (MUST come AFTER syncing groups).
145
-        if( array_key_exists('access', $data)) {
146
-            foreach($data['access'] as $group_id => $accessLevel) {
145
+        if (array_key_exists('access', $data)) {
146
+            foreach ($data['access'] as $group_id => $accessLevel) {
147 147
                 $user->groups()->updateExistingPivot($group_id, ['access' => $accessLevel]);
148 148
             }
149 149
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function destroy($userId)
160 160
     {
161
-        Storage::deleteDirectory('user_'.$userId);
161
+        Storage::deleteDirectory('user_' . $userId);
162 162
         User::findOrFail($userId)->delete();
163 163
 
164 164
         return "success";
Please login to merge, or discard this patch.
app/Http/Controllers/TravelController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     public function destroy($userID, $travelID)
61 61
     {
62 62
         Travel::findOrFail($travelID)->delete();
63
-        Storage::deleteDirectory('travel_'.$travelID);
63
+        Storage::deleteDirectory('travel_' . $travelID);
64 64
 
65 65
         return Redirect::back();
66 66
     }
Please login to merge, or discard this patch.
app/Http/Controllers/DutySwapController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $type = 'SET\\' . $data['type'];
17 17
         $dutyID = intval($data['duty']);
18 18
 
19
-        ( new DutyList($dutyID) )->processSwapRequest($dates, $IDs, $type);
19
+        (new DutyList($dutyID))->processSwapRequest($dates, $IDs, $type);
20 20
 
21 21
         return redirect()->action('DutyController@show', $dutyID);
22 22
 
Please login to merge, or discard this patch.
app/Http/Kernel.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             \SET\Http\Middleware\EncryptCookies::class,
24 24
             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
25 25
             \Illuminate\Session\Middleware\StartSession::class,
26
-			\Krucas\Notification\Middleware\NotificationMiddleware::class,
26
+            \Krucas\Notification\Middleware\NotificationMiddleware::class,
27 27
             \Illuminate\View\Middleware\ShareErrorsFromSession::class,
28 28
             \SET\Http\Middleware\VerifyCsrfToken::class,
29 29
             \Illuminate\Routing\Middleware\SubstituteBindings::class,
Please login to merge, or discard this patch.
app/Http/Requests/NewsRequest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function rules()
24 24
     {
25 25
         return [
26
-	        'title' => 'required',
26
+            'title' => 'required',
27 27
             'description' => 'required',
28 28
             'publish_date' => 'required',
29 29
             'expire_date' => 'after:publish_date'
Please login to merge, or discard this patch.
app/Http/Requests/TravelRequest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 class TravelRequest extends Request
6 6
 {
7 7
 
8
-	/**
8
+    /**
9 9
      * Determine if the user is authorized to make this request.
10 10
      *
11 11
      * @return bool
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
     public function rules()
24 24
     {
25 25
         return [
26
-			'location' => 'required',
26
+            'location' => 'required',
27 27
             'leave_date' => 'required',
28
-			'return_date' => 'required|after:leave_date'
28
+            'return_date' => 'required|after:leave_date'
29 29
         ];
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
app/Http/Requests/TrainingUserRequest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 class TrainingUserRequest extends Request
6 6
 {
7 7
 
8
-	/**
8
+    /**
9 9
      * Determine if the user is authorized to make this request.
10 10
      *
11 11
      * @return bool
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
     public function rules()
24 24
     {
25 25
         return [
26
-			'training_id' => 'required|integer',
26
+            'training_id' => 'required|integer',
27 27
             'due_date' => 'required'
28 28
         ];
29 29
     }
30 30
 	
31
-	/**
31
+    /**
32 32
      * Get the error messages for the defined validation rules.
33 33
      *
34 34
      * @return array
Please login to merge, or discard this patch.
app/Providers/AuthServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,34 +32,34 @@
 block discarded – undo
32 32
         $this->registerPolicies($gate);
33 33
 
34 34
         //user can edit this. AKA, they are an admin.
35
-        $gate->define('edit', function ($user) {
35
+        $gate->define('edit', function($user) {
36 36
             return $this->isAdmin($user);
37 37
         });
38 38
 
39 39
         //user has view rights
40
-        $gate->define('view', function ($user) {
40
+        $gate->define('view', function($user) {
41 41
             return $this->isViewer($user);
42 42
         });
43 43
 
44 44
         //Let admin update note & user update training note.
45
-        $gate->define('update_record', function ($user, $record) {
45
+        $gate->define('update_record', function($user, $record) {
46 46
             return ($user->id == $record->user_id || $this->isAdmin($user));
47 47
         });
48 48
 
49 49
         // primarily used to set javascript variable.
50
-        $gate->define('update_self', function ($user, $page) {
50
+        $gate->define('update_self', function($user, $page) {
51 51
             return $user->id == $page->id && !$this->isAdmin($user);
52 52
         });
53 53
 
54
-        $gate->define('show_user', function ($user, $page) {
54
+        $gate->define('show_user', function($user, $page) {
55 55
             return ($this->isViewer($user) || $user->id === $page->id);
56 56
         });
57 57
 
58
-        $gate->define('show_note', function ($user, $page) {
58
+        $gate->define('show_note', function($user, $page) {
59 59
             return ($this->isAdmin($user) || Note::findOrFail($page->id)->user()->id === $user->id);
60 60
         });
61 61
         
62
-        $gate->define('show_published_news', function ($user, $news) {
62
+        $gate->define('show_published_news', function($user, $news) {
63 63
             return ($this->isViewer($user) || 
64 64
                     ($news->publish_date <= Carbon::today() &&
65 65
                       ($news->expire_date >= Carbon::today() || 
Please login to merge, or discard this patch.
app/Providers/BroadcastServiceProvider.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
         /*
20 20
          * Authenticate the user's personal channel...
21 21
          */
22
-        Broadcast::channel('App.User.*', function ($user, $userId) {
22
+        Broadcast::channel('App.User.*', function($user, $userId) {
23 23
             return (int) $user->id === (int) $userId;
24 24
         });
25 25
     }
Please login to merge, or discard this patch.