Test Setup Failed
Pull Request — master (#266)
by Mohamed
07:49
created
app/Http/Controllers/ImportExport.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             try {
74 74
                 $files = Storage::disk('sis-bulk-data-files')->allFiles();
75 75
                 Excel::import($import, request()->file('import_file'));
76
-            }catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
76
+            } catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
77 77
                 $failures = $e->failures();
78 78
 
79 79
                 foreach ($failures as $failure) {
Please login to merge, or discard this patch.
app/Http/Middleware/classTeacher.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
 //        dd($request->user()->permissions);
19 19
         if ($request->user() && (!($request->user()->permissions->isEmpty())) && $request->user()->permissions[0]->roles && $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') {
20 20
             return $next($request);
21
-        }elseif ($request->user() && (!($request->user()->principal->isEmpty())) && $request->user()->principal[0]->roles && $request->user()->principal[0]->roles->code === 'PRINCIPAL') {
21
+        } elseif ($request->user() && (!($request->user()->principal->isEmpty())) && $request->user()->principal[0]->roles && $request->user()->principal[0]->roles->code === 'PRINCIPAL') {
22 22
             return $next($request);
23
-        }elseif ($request->user() && (!($request->user()->zonal_cordinator->isEmpty())) && $request->user()->zonal_cordinator[0]->roles && $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL') {
23
+        } elseif ($request->user() && (!($request->user()->zonal_cordinator->isEmpty())) && $request->user()->zonal_cordinator[0]->roles && $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL') {
24 24
             return $next($request);
25 25
         }
26 26
         return redirect('/login')->with('status', 'Your dont have access for upload data. Please get assign your to the class and try');
Please login to merge, or discard this patch.
app/Imports/Import.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             $rowData = $this->worksheet->rangeToArray('A'.$row.':'.$highestColumn.$row, NULL, TRUE, FALSE);
88 88
             if (isEmptyRow(reset($rowData))) {
89 89
                 continue;
90
-            }else {
90
+            } else {
91 91
                 $higestRow += 1;
92 92
             }
93 93
         }
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
             $rowData = $this->worksheet->rangeToArray('A'.$row.':'.$highestColumn.$row, NULL, TRUE, FALSE);
115 115
             if (isEmptyRow(reset($rowData))) {
116 116
                 continue;
117
-            }else {
117
+            } else {
118 118
                 $higestRow += 1;
119 119
             }
120 120
         }
121 121
         if ($higestRow == 0) {
122 122
             exit;
123
-        }else {
123
+        } else {
124 124
             return $higestRow;
125 125
         }
126 126
     }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 }
151 151
             }
152 152
             return $row;
153
-        }catch (Exception $e) {
153
+        } catch (Exception $e) {
154 154
             $error = \Illuminate\Validation\ValidationException::withMessages([]);
155 155
             $failure = new Failure(3, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'], [null]);
156 156
             $failures = [0 => $failure];
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     protected function checkKeys($key,$count,$row){
197 197
         if(array_key_exists($key,$row)){
198 198
             return true;
199
-        }else{
199
+        } else{
200 200
             $error = \Illuminate\Validation\ValidationException::withMessages([]);
201 201
             $failure = new Failure($count, 'remark', [0 => 'Template is not valid for upload, use the template given in the system'. $key ,' Is missing form the template'], [null]);
202 202
             $failures = [0 => $failure];
@@ -243,10 +243,10 @@  discard block
 block discarded – undo
243 243
                 $failures = [0 => $failure];
244 244
                 throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures);
245 245
                 Log::info('email-sent', [$this->file]);
246
-            }catch (Exception $e) {
246
+            } catch (Exception $e) {
247 247
                 Log::info('email-sending-failed', [$e]);
248 248
             }
249
-        }else {
249
+        } else {
250 250
             return true;
251 251
         }
252 252
     }
Please login to merge, or discard this patch.
app/Imports/UsersImport.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                             User_contact::createOrUpdate($father, $this->file['security_user_id']);
299 299
                         }
300 300
                         Student_guardian::createStudentGuardian($student, $father, $this->file['security_user_id']);
301
-                    }else {
301
+                    } else {
302 302
                         Security_user::where('id', '=', $father->id)
303 303
                                 ->update(['is_guardian' => 1]);
304 304
                         $father['guardian_relation_id'] = 1;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                             User_contact::createOrUpdate($mother, $this->file['security_user_id']);
359 359
                         }
360 360
                         Student_guardian::createStudentGuardian($student, $mother, $this->file['security_user_id']);
361
-                    }else {
361
+                    } else {
362 362
                         Security_user::where('id', '=', $mother->id)
363 363
                                 ->update(['is_guardian' => 1]);
364 364
                         $mother['guardian_relation_id'] = 2;
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
                             User_contact::createOrUpdate($guardian, $this->file['security_user_id']);
421 421
                         }    
422 422
                         Student_guardian::createStudentGuardian($student, $guardian, $this->file['security_user_id']);
423
-                    }else {
423
+                    } else {
424 424
                         Security_user::where('id', '=', $guardian->id)
425 425
                                 ->update(['is_guardian' => 1]);
426 426
                         $guardian['guardian_relation_id'] = 3;
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                             'total_male_students' => $totalStudents['total_male_students'],
466 466
                             'total_female_students' => $totalStudents['total_female_students']]);
467 467
             }
468
-        }catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
468
+        } catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
469 469
             $error = \Illuminate\Validation\ValidationException::withMessages([]);
470 470
 //            $failure = new Failure(3, 'remark', [3 => ], [null]);
471 471
             $failures = $e->failures();
Please login to merge, or discard this patch.
app/Imports/StudentUpdate.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                             User_contact::createOrUpdate($father, $this->file['security_user_id']);
257 257
                         }
258 258
                         Student_guardian::createStudentGuardian($student, $father, $this->file['security_user_id']);
259
-                    }else {
259
+                    } else {
260 260
                         Security_user::where('id', '=', $father->id)
261 261
                                 ->update(['is_guardian' => 1]);
262 262
                         $father['guardian_relation_id'] = 1;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
                             User_contact::createOrUpdate($mother, $this->file['security_user_id']);
308 308
                         }   
309 309
                         Student_guardian::createStudentGuardian($student, $mother, $this->file['security_user_id']);
310
-                    }else {
310
+                    } else {
311 311
                         Security_user::where('id', '=', $mother->id)
312 312
                                 ->update(['is_guardian' => 1]);
313 313
                         $mother['guardian_relation_id'] = 2;
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                             User_contact::createOrUpdate($guardian, $this->file['security_user_id']);
362 362
                         }  
363 363
                         Student_guardian::createStudentGuardian($student, $guardian, $this->file['security_user_id']);
364
-                    }else {
364
+                    } else {
365 365
                         Security_user::where('id', '=', $guardian->id)
366 366
                                 ->update(['is_guardian' => 1]);
367 367
                         $guardian['guardian_relation_id'] = 3;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
                             'total_male_students' => $totalStudents['total_male_students'],
409 409
                             'total_female_students' => $totalStudents['total_female_students']]);
410 410
             }
411
-        }catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
411
+        } catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
412 412
             $error = \Illuminate\Validation\ValidationException::withMessages([]);
413 413
             $failures = $e->failures();
414 414
             throw new \Maatwebsite\Excel\Validators\ValidationException($error, $failures);
@@ -423,8 +423,9 @@  discard block
 block discarded – undo
423 423
     }
424 424
 
425 425
     protected function insertSubject($subject) {
426
-        if (!Institution_subject_student::isDuplicated($subject))
427
-                Institution_subject_student::updateOrInsert($subject);
426
+        if (!Institution_subject_student::isDuplicated($subject)) {
427
+                        Institution_subject_student::updateOrInsert($subject);
428
+        }
428 429
     }
429 430
 
430 431
 
Please login to merge, or discard this patch.