Completed
Push — master ( 1bb6c6...ee518d )
by Ron
10:42 queued 05:15
created
app/Http/Controllers/TechTipsController.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
             $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%')
58 58
                 ->whereHas('TechTipSystems', function($q) use($request)
59 59
                 {
60
-                   $q->where('sys_id', $request->system);
60
+                    $q->where('sys_id', $request->system);
61 61
                 })
62 62
                 ->get();
63 63
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
                    $q->where('sys_id', $request->system);
61 61
                 })
62 62
                 ->get();
63
-        }
64
-        else
63
+        } else
65 64
         {
66 65
             $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%')
67 66
                 ->get();
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
                     'sys_id' => $tag
119 118
                 ]);
120 119
             }
121
-        }
122
-        else
120
+        } else
123 121
         {
124 122
             TechTipSystems::create([
125 123
                 'tip_id' => $tipID,
@@ -158,8 +156,7 @@  discard block
 block discarded – undo
158 156
         try
159 157
         {
160 158
             Mail::to($userList)->send(new newTechtip($tipData));
161
-        }
162
-        catch(Exception $e)
159
+        } catch(Exception $e)
163 160
         {
164 161
             report($e);
165 162
         }
@@ -285,8 +282,7 @@  discard block
 block discarded – undo
285 282
                     'sys_id' => $tag
286 283
                 ]);
287 284
             }
288
-        }
289
-        else
285
+        } else
290 286
         {
291 287
             TechTipSystems::create([
292 288
                 'tip_id' => $id,
@@ -308,8 +304,7 @@  discard block
 block discarded – undo
308 304
                         Files::deleteFile($file->file_id);
309 305
                     }
310 306
                 }
311
-            }
312
-            else
307
+            } else
313 308
             {
314 309
                 TechTipFiles::where('tip_id', $id)->delete();
315 310
             }
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
             ->get();
36 36
         
37 37
         $sysArr = [];
38
-        foreach($systems as $sys)
38
+        foreach ($systems as $sys)
39 39
         {
40
-            foreach($sys->SystemTypes as $s)
40
+            foreach ($sys->SystemTypes as $s)
41 41
             {
42 42
                 $sysArr[$sys->name][$s->sys_id] = $s->name;
43 43
             }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function search(Request $request)
53 53
     {
54 54
         //  Run different request based on if system field is filled out or not
55
-        if(!empty($request->system))
55
+        if (!empty($request->system))
56 56
         {
57 57
             $tipData = TechTips::where('subject', 'like', '%'.$request->tipSearch.'%')
58 58
                 ->whereHas('TechTipSystems', function($q) use($request)
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             ->get();
82 82
         
83 83
         $sysArr = [];
84
-        foreach($systems as $sys)
84
+        foreach ($systems as $sys)
85 85
         {
86
-            foreach($sys->SystemTypes as $s)
86
+            foreach ($sys->SystemTypes as $s)
87 87
             {
88 88
                 $sysArr[$sys->name][$s->sys_id] = $s->name;
89 89
             }
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
         $tipID = $tip->tip_id;
113 113
 
114 114
         //  Enter all system tags associated with the tip
115
-        if(is_array($request->sysTags))
115
+        if (is_array($request->sysTags))
116 116
         {
117 117
             
118
-            foreach($request->sysTags as $tag)
118
+            foreach ($request->sysTags as $tag)
119 119
             {
120 120
                 TechTipSystems::create([
121 121
                     'tip_id' => $tipID,
@@ -132,10 +132,10 @@  discard block
 block discarded – undo
132 132
         }
133 133
         
134 134
         //  If there are any files, process them
135
-        if(!empty($request->file))
135
+        if (!empty($request->file))
136 136
         {
137 137
             $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$tipID;
138
-            foreach($request->file as $file)
138
+            foreach ($request->file as $file)
139 139
             {
140 140
                 //  Clean the file and store it
141 141
                 $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         {
164 164
             Mail::to($userList)->send(new newTechtip($tipData));
165 165
         }
166
-        catch(Exception $e)
166
+        catch (Exception $e)
167 167
         {
168 168
             report($e);
169 169
         }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     public function details($id, $name)
178 178
     {
179 179
         $tipData = TechTips::where('tip_id', $id)->with('user')->first();
180
-        if(empty($tipData))
180
+        if (empty($tipData))
181 181
         {
182 182
             Log::warning('User ID-'.Auth::user()->user_id.' tried to access invlaid Tech Tip ID-'.$id.' Name-'.$name);
183 183
             return view('err.tipNotFound');
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     public function edit($id)
227 227
     {
228 228
         $tipData = TechTips::find($id);
229
-        if(empty($tipData))
229
+        if (empty($tipData))
230 230
         {
231 231
             return 'tip not found';
232 232
         }
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
             ->get();
250 250
         
251 251
         $sysArr = [];
252
-        foreach($systems as $sys)
252
+        foreach ($systems as $sys)
253 253
         {
254
-            foreach($sys->SystemTypes as $s)
254
+            foreach ($sys->SystemTypes as $s)
255 255
             {
256 256
                 $sysArr[$sys->name][$s->sys_id] = $s->name;
257 257
             }
@@ -284,9 +284,9 @@  discard block
 block discarded – undo
284 284
         
285 285
         //  Enter all system tags associated with the tip after destroying the existing systems
286 286
         TechTipSystems::where('tip_id', $id)->delete();
287
-        if(is_array($request->sysTags))
287
+        if (is_array($request->sysTags))
288 288
         {
289
-            foreach($request->sysTags as $tag)
289
+            foreach ($request->sysTags as $tag)
290 290
             {
291 291
                 TechTipSystems::create([
292 292
                     'tip_id' => $id,
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
         
305 305
         //  Determine if any files were removed
306 306
         $tipFiles = TechTipFiles::where('tip_id', $id)->get();
307
-        if(!$tipFiles->isEmpty())
307
+        if (!$tipFiles->isEmpty())
308 308
         {
309
-            if(!empty($request->existingFile))
309
+            if (!empty($request->existingFile))
310 310
             {
311
-                foreach($tipFiles as $file)
311
+                foreach ($tipFiles as $file)
312 312
                 {
313
-                    if(!in_array($file->file_id, $request->existingFile))
313
+                    if (!in_array($file->file_id, $request->existingFile))
314 314
                     {
315 315
                         TechTipFiles::where('file_id', $file->file_id)->delete();
316 316
                         Files::deleteFile($file->file_id);
@@ -324,10 +324,10 @@  discard block
 block discarded – undo
324 324
         }
325 325
         
326 326
         //  Process any new files
327
-        if(!empty($request->file))
327
+        if (!empty($request->file))
328 328
         {
329 329
             $filePath = config('filesystems.paths.tips').DIRECTORY_SEPARATOR.$id;
330
-            foreach($request->file as $file)
330
+            foreach ($request->file as $file)
331 331
             {
332 332
                 //  Clean the file and store it
333 333
                 $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
Please login to merge, or discard this patch.
app/Http/Controllers/UserLinksController.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,4 +100,4 @@
 block discarded – undo
100 100
         return $request->all();
101 101
     }
102 102
 }
103
- 
104 103
\ No newline at end of file
104
+    
105 105
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
         $details = FileLinks::where('link_hash', $id)->first();
26 26
         
27 27
         //  Verify that the link is valid
28
-        if(empty($details))
28
+        if (empty($details))
29 29
         {
30 30
             return view('links.guest.badLink');
31 31
         }
32 32
         //  Verify that the link has not expired
33
-        else if($details->expire <= date('Y-m-d'))
33
+        else if ($details->expire<=date('Y-m-d'))
34 34
         {
35 35
             return view('links.guest.expiredLink');
36 36
         }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         
56 56
         $filePath = config('filesystems.paths.links').DIRECTORY_SEPARATOR.$details->link_id;
57 57
 
58
-        foreach($request->file as $file)
58
+        foreach ($request->file as $file)
59 59
         {
60 60
             //  Clean the file and store it
61 61
             $fileName = Files::cleanFilename($filePath, $file->getClientOriginalName());
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 'upload' => 1
77 77
             ]);
78 78
             
79
-            if(!empty($request->note))
79
+            if (!empty($request->note))
80 80
             {
81 81
                 FileLinkNotes::create([
82 82
                     'link_id' => $details->link_id,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         {
93 93
             Mail::to($user)->send(new NewLinkFile($details));
94 94
         }
95
-        catch(Exception $e)
95
+        catch (Exception $e)
96 96
         {
97 97
             report($e);
98 98
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@
 block discarded – undo
91 91
         try
92 92
         {
93 93
             Mail::to($user)->send(new NewLinkFile($details));
94
-        }
95
-        catch(Exception $e)
94
+        } catch(Exception $e)
96 95
         {
97 96
             report($e);
98 97
         }
Please login to merge, or discard this patch.
app/Http/Controllers/CustomerFilesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $fileTypes = CustomerFileTypes::all();
25 25
         $fTypes = [];
26
-        foreach($fileTypes as $type)
26
+        foreach ($fileTypes as $type)
27 27
         {
28 28
             $fTypes[$type->file_type_id] = $type->description;
29 29
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $custFile = CustomerFiles::find($id);
94 94
         $fileTypes = CustomerFileTypes::all();
95 95
         $fTypes = [];
96
-        foreach($fileTypes as $type)
96
+        foreach ($fileTypes as $type)
97 97
         {
98 98
             $fTypes[$type->file_type_id] = $type->description;
99 99
         }
Please login to merge, or discard this patch.
app/Http/Controllers/CustomerContactsController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $numberTypes = PhoneNumberType::all();
27 27
         
28 28
         $numTypes = [];
29
-        foreach($numberTypes as $type)
29
+        foreach ($numberTypes as $type)
30 30
         {
31 31
             $numTypes[$type->phone_type_id] = $type->description;
32 32
         }
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         
50 50
         $contID = $cont->cont_id;
51 51
         
52
-        if(!empty(array_filter($request['phoneNumber'])))
52
+        if (!empty(array_filter($request['phoneNumber'])))
53 53
         {
54 54
             $num = count($request['phoneNumber']);
55
-            for($i=0; $i < $num; $i++)
55
+            for ($i = 0; $i<$num; $i++)
56 56
             {
57
-                if(!empty($request['phoneNumber'][$i]))
57
+                if (!empty($request['phoneNumber'][$i]))
58 58
                 {
59 59
                     CustomerContactPhones::create([
60 60
                         'cont_id' => $contID,
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $numberTypes = PhoneNumberType::all();
88 88
         
89 89
         $numTypes = [];
90
-        foreach($numberTypes as $type)
90
+        foreach ($numberTypes as $type)
91 91
         {
92 92
             $numTypes[$type->phone_type_id] = $type->description;
93 93
         }
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
         
114 114
         //  Clear all contact phone numbers and re-enter them
115 115
         CustomerContactPhones::where('cont_id', $id)->delete();
116
-        if(!empty(array_filter($request['phoneNumber'])))
116
+        if (!empty(array_filter($request['phoneNumber'])))
117 117
         {
118 118
             $num = count($request['phoneNumber']);
119
-            for($i=0; $i < $num; $i++)
119
+            for ($i = 0; $i<$num; $i++)
120 120
             {
121 121
                 CustomerContactPhones::create([
122 122
                     'cont_id'       => $id,
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
         $vcard->addEmail($contact->email);
159 159
         $vcard->addAddress(null, null, $custData->address, $custData->city, $custData->state, $custData->zip, null);
160 160
         
161
-        if(!empty($numbers))
161
+        if (!empty($numbers))
162 162
         {
163
-            foreach($numbers as $phone)
163
+            foreach ($numbers as $phone)
164 164
             {
165 165
                 $vcard->addPhoneNumber($phone->phone_number, $phone->description);
166 166
             }
Please login to merge, or discard this patch.
app/Http/Controllers/CustomerDetails.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $custDetails = Customers::find($id);
56 56
         
57 57
         //  Check for empty data set
58
-        if(empty($custDetails))
58
+        if (empty($custDetails))
59 59
         {
60 60
             return view('err.customerNotFound');
61 61
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         Customers::find($id)->update($request->all());
91 91
 
92 92
         //  Modify to the new ID number if set
93
-        if(isset($request->cust_id))
93
+        if (isset($request->cust_id))
94 94
         {
95 95
             $id = $request->cust_id;
96 96
         }
Please login to merge, or discard this patch.
app/Exceptions/Handler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function report(Exception $exception)
37 37
     {
38
-        if(config('app.debug'))
38
+        if (config('app.debug'))
39 39
         {
40 40
             parent::report($exception);
41 41
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@
 block discarded – undo
38 38
         if(config('app.debug'))
39 39
         {
40 40
             parent::report($exception);
41
-        }
42
-        else
41
+        } else
43 42
         {
44 43
             Log::error('['.$exception->getCode().'] "'.$exception->getMessage().'" on line '.$exception->getTrace()[0]['line'].' of file '.$exception->getTrace()[0]['file']);
45 44
         }
Please login to merge, or discard this patch.
app/Http/Controllers/UserController.php 3 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@  discard block
 block discarded – undo
43 43
             if($role->role_id == 1 && Auth::user()->role_id != 1)
44 44
             {
45 45
                 continue;
46
-            }
47
-            else
46
+            } else
48 47
             {
49 48
                 $roleArr[$role->role_id] = $role->name;
50 49
             }
@@ -94,8 +93,7 @@  discard block
 block discarded – undo
94 93
         try
95 94
         {
96 95
             Mail::to($request->email)->send(new InitializeUser($hash, $request->username, $request->first_name.' '.$request->last_name));
97
-        }
98
-        catch(Exception $e)
96
+        } catch(Exception $e)
99 97
         {
100 98
             report($e);
101 99
         }
@@ -203,8 +201,7 @@  discard block
 block discarded – undo
203 201
             if($role->role_id == 1 && Auth::user()->role_id != 1)
204 202
             {
205 203
                 continue;
206
-            }
207
-            else
204
+            } else
208 205
             {
209 206
                 $roleArr[$role->role_id] = $role->name;
210 207
             }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         
147 147
         $nextChange = config('users.passExpires') != null ? Carbon::now()->addDays(config('users.passExpires')) : null;
148 148
         
149
-         //  Update the password
149
+            //  Update the password
150 150
         User::find($userData->user_id)->update(
151 151
         [
152 152
             'password'         => bcrypt($request->newPass),
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         
188 188
         $nextChange = isset($request->force_change) && $request->force_change == 'on' ? Carbon::now()->subDay() : null;
189 189
         
190
-         //  Update the user data
190
+            //  Update the user data
191 191
         User::find($id)->update(
192 192
         [
193 193
             'password'         => bcrypt($request->password),
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     //  Deactivae an active user
261 261
     public function destroy($id)
262 262
     {
263
-         //  Update the user data
263
+            //  Update the user data
264 264
         User::find($id)->update(
265 265
         [
266 266
             'active'   => 0
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
         $roles = Role::all();
40 40
         
41 41
         $roleArr = [];
42
-        foreach($roles as $role)
42
+        foreach ($roles as $role)
43 43
         {
44
-            if($role->role_id == 1 && Auth::user()->role_id != 1)
44
+            if ($role->role_id == 1 && Auth::user()->role_id != 1)
45 45
             {
46 46
                 continue;
47 47
             }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         {
96 96
             Mail::to($request->email)->send(new InitializeUser($hash, $request->username, $request->first_name.' '.$request->last_name));
97 97
         }
98
-        catch(Exception $e)
98
+        catch (Exception $e)
99 99
         {
100 100
             report($e);
101 101
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         //  Validate the hash token
114 114
         $user = UserInitialize::where('token', $hash)->get();
115 115
         
116
-        if($user->isEmpty())
116
+        if ($user->isEmpty())
117 117
         {
118 118
             return abort(404);
119 119
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     {
127 127
         //  Verify that the link matches the assigned email address
128 128
         $valid = UserInitialize::where('token', $hash)->first();
129
-        if(empty($valid))
129
+        if (empty($valid))
130 130
         {
131 131
             Log::notice('Someone tried to access an invalid User Initialization link - '.$hash);
132 132
             return abort(404);
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
         $userRole = DB::select('SELECT `role_id` FROM `user_role` WHERE `user_id` = ?', [$id])[0]->role_id;
207 207
         
208 208
         $roleArr = [];
209
-        foreach($roles as $role)
209
+        foreach ($roles as $role)
210 210
         {
211
-            if($role->role_id == 1 && Auth::user()->role_id != 1)
211
+            if ($role->role_id == 1 && Auth::user()->role_id != 1)
212 212
             {
213 213
                 continue;
214 214
             }
Please login to merge, or discard this patch.
app/Http/Middleware/CheckPasswordExpire.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $user = $request->user();
22 22
         $passExp = new Carbon(($user->password_expires));
23 23
         
24
-        if(!empty($passExp) && Carbon::now() > $passExp && !empty(config('users.passExpires')))
24
+        if (!empty($passExp) && Carbon::now()>$passExp && !empty(config('users.passExpires')))
25 25
         {
26 26
             Log::notice('User ID-'.Auth::user()->user_id.' is being forced to change their password.');
27 27
             $request->session()->flash('change_password', 'change_password');
Please login to merge, or discard this patch.
app/Http/Middleware/CheckRole.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     public function handle($request, Closure $next)
17 17
     {
18
-        if($request->user() === null)
18
+        if ($request->user() === null)
19 19
         {
20 20
             Log::alert($request->route().' denied for Guest');
21 21
             return response('Insufficient Permissions', 401);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $actions = $request->route()->getAction();
24 24
         $roles = isset($actions['roles']) ? $actions['roles'] : null;
25 25
         
26
-        if($request->user()->hasAnyRole($roles)  || !$roles)
26
+        if ($request->user()->hasAnyRole($roles) || !$roles)
27 27
         {
28 28
             return $next($request);
29 29
         }
Please login to merge, or discard this patch.