Test Setup Failed
Pull Request — master (#566)
by
unknown
06:28
created
app/Models/Institution_class_student.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     public static function boot()
54 54
     {
55 55
         parent::boot();
56
-        self::creating(function ($model) {
56
+        self::creating(function($model) {
57 57
             $model->id = (string) Uuid::generate(4);
58 58
             $model->created = now();
59 59
         });
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 
67 67
     public  static function getStudentsCount($institution_class_id)
68 68
     {
69
-        $total_male_students = self::with(['student' => function ($query) {
69
+        $total_male_students = self::with(['student' => function($query) {
70 70
             $query->where('student.gender_id', '=', 1);
71
-        }])->whereHas('student', function ($query) {
71
+        }])->whereHas('student', function($query) {
72 72
             $query->where('gender_id', '=', 1);
73 73
         })->where('institution_class_id', '=', $institution_class_id)->count();
74 74
 
75
-        $total_female_students = self::with(['student' => function ($query) {
75
+        $total_female_students = self::with(['student' => function($query) {
76 76
             $query->where('student.gender_id', '=', 2);
77
-        }])->whereHas('student', function ($query) {
77
+        }])->whereHas('student', function($query) {
78 78
             $query->where('gender_id', '=', 2);
79 79
         })->where('institution_class_id', '=', $institution_class_id)->count();
80 80
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                 'institution_id' => $admissionInfo['instituion']->id,
127 127
                 'student_status_id' => 1
128 128
             ]);
129
-        } catch (\Throwable $th) {
129
+        }catch (\Throwable $th) {
130 130
             Log::error($th);
131 131
         }
132 132
     }
Please login to merge, or discard this patch.
app/Models/Examination_student.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@
 block discarded – undo
52 52
         $value = self::where('st_no', $data['st_no'])->get();
53 53
         if (count($value) > 0) {
54 54
             self::where('st_no', $data['st_no'])->update($data);
55
-        } else {
55
+        }else {
56 56
             self::insert($data);
57 57
         }
58
-        $output->writeln('Student name: ' . ($data['f_name']) . ' has been inserted to the database');
58
+        $output->writeln('Student name: '.($data['f_name']).' has been inserted to the database');
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
app/Http/Middleware/classTeacher.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
      */
16 16
     public function handle($request, Closure $next)
17 17
     {
18
-        if($request->user()->super_admin == 1){
18
+        if ($request->user()->super_admin == 1) {
19 19
             return $next($request);
20
-        }elseif ($request->user() && (!($request->user()->permissions->isEmpty()))  && $request->user()->permissions[0]->roles &&  $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') {
20
+        }elseif ($request->user() && (!($request->user()->permissions->isEmpty())) && $request->user()->permissions[0]->roles && $request->user()->permissions[0]->roles->code === 'HOMEROOM_TEACHER') {
21 21
             return $next($request);
22
-        }elseif($request->user() && (!($request->user()->principal->isEmpty()))  && $request->user()->principal[0]->roles &&  $request->user()->principal[0]->roles->code === 'PRINCIPAL'){
22
+        }elseif ($request->user() && (!($request->user()->principal->isEmpty())) && $request->user()->principal[0]->roles && $request->user()->principal[0]->roles->code === 'PRINCIPAL') {
23 23
             return $next($request);
24
-        }elseif($request->user() && (!($request->user()->zonal_cordinator->isEmpty()))  && $request->user()->zonal_cordinator[0]->roles &&  $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL'){
24
+        }elseif ($request->user() && (!($request->user()->zonal_cordinator->isEmpty())) && $request->user()->zonal_cordinator[0]->roles && $request->user()->zonal_cordinator[0]->roles->code === 'PRINCIPAL') {
25 25
             return $next($request);
26 26
         }
27 27
         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/Http/Controllers/ImportExport.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     */
35 35
     public function importExportView()
36 36
     {
37
-        if(Auth::user()->super_admin ){
37
+        if (Auth::user()->super_admin) {
38 38
             return view('uploadcsv');
39
-        }else{
40
-            $classes = (!Auth::user()->permissions->isEmpty())  ?  Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes;
41
-            return view('importExport')->with('classes',$classes);
39
+        }else {
40
+            $classes = (!Auth::user()->permissions->isEmpty()) ?  Auth::user()->permissions[0]->staff_class : Auth::user()->principal[0]->security_group_institution->institution_classes;
41
+            return view('importExport')->with('classes', $classes);
42 42
         }
43 43
     }
44 44
 
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
 
74 74
 
75 75
             $import = new UsersImport();
76
-            try{
76
+            try {
77 77
                 $files = Storage::disk('sis-bulk-data-files')->allFiles();
78
-                Excel::import($import,request()->file('import_file'));
78
+                Excel::import($import, request()->file('import_file'));
79 79
             }catch (\Maatwebsite\Excel\Validators\ValidationException $e) {
80 80
                 $failures = $e->failures();
81 81
 
Please login to merge, or discard this patch.
app/Models/Institution_student.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public static function boot()
64 64
     {
65 65
         parent::boot();
66
-        self::creating(function ($model) {
66
+        self::creating(function($model) {
67 67
             $model->id = (string) Uuid::generate(4);
68 68
             $model->created = now();
69 69
         });
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public static function createExaminationData($student, $admissionInfo)
134 134
     {
135
-        $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ?  $student['sp_center'] : 0;
135
+        $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0;
136 136
         try {
137 137
             self::create([
138 138
                 'id' => (string) Uuid::generate(4),
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 'created' => now(),
157 157
                 'created_user_id' => 1
158 158
             ]);
159
-        } catch (\Throwable $th) {
159
+        }catch (\Throwable $th) {
160 160
             Log::error($th);
161 161
         }
162 162
     }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public static function updateExaminationData($student, $admissionInfo)
172 172
     {
173
-        $student['sp_center'] = gettype((int)$student['sp_center']) == 'integer' ?  $student['sp_center'] : 0;
173
+        $student['sp_center'] = gettype((int) $student['sp_center']) == 'integer' ? $student['sp_center'] : 0;
174 174
         try {
175 175
             self::where([
176 176
                 'student_id' => $student['student_id'],
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                     'modified_user_id' => 1
192 192
                 ]
193 193
             );
194
-        } catch (\Throwable $th) {
194
+        }catch (\Throwable $th) {
195 195
             Log::error($th);
196 196
         }
197 197
     }
Please login to merge, or discard this patch.
app/Providers/ValidatorExtended.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -70,17 +70,17 @@  discard block
 block discarded – undo
70 70
             if (empty($value)) {
71 71
                 return false;
72 72
             } elseif ($gradeEntity !== null) {
73
-                $admissionAge = (($gradeEntity->admission_age) * 12) - 1;
73
+                $admissionAge = (($gradeEntity->admission_age)*12) - 1;
74 74
                 $to = $academicPeriod->start_date;
75 75
                 $diff_in_months = $to->diffInMonths($value);
76 76
                 $ageOfStudent = $diff_in_months;
77 77
                 $enrolmentMaximumAge = $admissionAge + 120;
78 78
                 return ($ageOfStudent <= $enrolmentMaximumAge) && ($ageOfStudent >= $admissionAge);
79
-            } else {
79
+            }else {
80 80
                 return false;
81 81
             }
82
-        } else {
83
-            $this->_custom_messages['admission_age'] = 'given' . $attribute . 'Not found';
82
+        }else {
83
+            $this->_custom_messages['admission_age'] = 'given'.$attribute.'Not found';
84 84
             $this->_set_custom_stuff();
85 85
             return false;
86 86
         }
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 
92 92
         if (is_numeric($value)) {
93 93
             if ($value < 10) {
94
-                $this->_custom_messages['bmi'] =  $attribute . ' is must greater than 10';
94
+                $this->_custom_messages['bmi'] = $attribute.' is must greater than 10';
95 95
                 $this->_set_custom_stuff();
96 96
                 return false;
97 97
             } elseif ($value > 250) {
98
-                $this->_custom_messages['bmi'] =  $attribute . ' is must smaller than 250';
98
+                $this->_custom_messages['bmi'] = $attribute.' is must smaller than 250';
99 99
                 $this->_set_custom_stuff();
100 100
                 return false;
101 101
             }
102
-        } else {
103
-            $this->_custom_messages['bmi'] =  $attribute . ' is must a valid numeric';
102
+        }else {
103
+            $this->_custom_messages['bmi'] = $attribute.' is must a valid numeric';
104 104
             $this->_set_custom_stuff();
105 105
             return false;
106 106
         }
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
 
110 110
     protected function validateBmi($attribute, $value, $parameters)
111 111
     {
112
-        $bmiGrades =  ['G1', 'G4', 'G7', 'G10'];
112
+        $bmiGrades = ['G1', 'G4', 'G7', 'G10'];
113 113
         $institutionGrade = Institution_class_grade::where('institution_class_id', '=', $parameters[0])
114 114
             ->join('education_grades', 'institution_class_grades.education_grade_id', 'education_grades.id')
115 115
             ->first();
116
-        $educationGrade =  Education_grade::where('id', '=', $institutionGrade->education_grade_id)->first();
116
+        $educationGrade = Education_grade::where('id', '=', $institutionGrade->education_grade_id)->first();
117 117
         if (in_array($institutionGrade->code, $bmiGrades)) {
118 118
             if (!empty($value)) {
119 119
                 if (($attribute == 'bmi_height') || ('bmi_weight')) {
120 120
                     return $this->validateHW($attribute, $value);
121 121
                 }
122
-            } else {
123
-                $this->_custom_messages['bmi'] =  $attribute . ' is required for ' . $educationGrade->name;
122
+            }else {
123
+                $this->_custom_messages['bmi'] = $attribute.' is required for '.$educationGrade->name;
124 124
                 $this->_set_custom_stuff();
125 125
                 return false;
126 126
             }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             if (($attribute == 'bmi_height') || ('bmi_weight')) {
129 129
                 return $this->validateHW($attribute, $value);
130 130
             }
131
-        } else {
131
+        }else {
132 132
             return true;
133 133
         }
134 134
     }
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
     {
138 138
         foreach ($validator->getData() as $data) {
139 139
             if ($data['identity_type'] == 'BC' && key_exists('birth_divisional_secretariat', $data)) {
140
-                $BirthDivision = Area_administrative::where('name', '=',  '%' . $data['birth_divisional_secretariat'] . '%')->where('area_administrative_level_id', '=', 5); //
140
+                $BirthDivision = Area_administrative::where('name', '=', '%'.$data['birth_divisional_secretariat'].'%')->where('area_administrative_level_id', '=', 5); //
141 141
                 if ($BirthDivision->count() > 0) {
142
-                    $BirthArea = Area_administrative::where('name', '=', '%' . $value . '%') //$data['birth_registrar_office_as_in_birth_certificate']
142
+                    $BirthArea = Area_administrative::where('name', '=', '%'.$value.'%') //$data['birth_registrar_office_as_in_birth_certificate']
143 143
                         ->where('parent_id', '=', $BirthDivision->first()->id)->count();
144
-                    return $BirthArea  > 0;
144
+                    return $BirthArea > 0;
145 145
                 } elseif (key_exists('birth_divisional_secretariat', $data) && (!key_exists('birth_registrar_office_as_in_birth_certificate', $data))) {
146 146
                     $this->_custom_messages['birth_place'] = 'birth_registrar_office_as_in_birth_certificate required with BC';
147 147
                     $this->_set_custom_stuff();
148 148
                     return false;
149
-                } else {
149
+                }else {
150 150
                     return true;
151 151
                 }
152
-            } else {
152
+            }else {
153 153
                 return true;
154 154
             }
155 155
         }
@@ -157,16 +157,16 @@  discard block
 block discarded – undo
157 157
 
158 158
     protected function validateIsStudentInClass($attribute, $value, $perameters, $validator)
159 159
     {
160
-        $student =  Security_user::where('openemis_no', '=', $value);
160
+        $student = Security_user::where('openemis_no', '=', $value);
161 161
         if ($student->count() > 0) {
162 162
             $student = $student->first()->toArray();
163
-            $check =  Institution_class_student::where('student_id', '=', $student['id'])->where('institution_class_id', '=', $perameters[0])->count();
163
+            $check = Institution_class_student::where('student_id', '=', $student['id'])->where('institution_class_id', '=', $perameters[0])->count();
164 164
             if ($check == 1) {
165 165
                 return true;
166
-            } else {
166
+            }else {
167 167
                 return false;
168 168
             }
169
-        } else {
169
+        }else {
170 170
             return false;
171 171
         }
172 172
     }
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
     {
175 175
         $valid = preg_match('/^([0-9]{9}[VX]|[0-9]{12})$/i', $value);
176 176
         if (!$valid) {
177
-            $this->_custom_messages['nic'] = $attribute . ' is not valid,  Please check the NIC number';
177
+            $this->_custom_messages['nic'] = $attribute.' is not valid,  Please check the NIC number';
178 178
             $this->_set_custom_stuff();
179 179
             return false;
180
-        } else {
180
+        }else {
181 181
             return true;
182 182
         }
183 183
     }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     protected function validateUserUnique($attribute, $value, $perameters, $validator)
186 186
     {
187 187
         foreach ($validator->getData() as $data) {
188
-            $identityType = Identity_type::where('national_code', 'like', '%' . $data['identity_type'] . '%')->first();
188
+            $identityType = Identity_type::where('national_code', 'like', '%'.$data['identity_type'].'%')->first();
189 189
             if ($identityType !== null && ($value !== null)) {
190 190
                 if ($identityType->national_code === 'BC') {
191 191
                     return $this->checkUnique($value, $data, $identityType);
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
     protected function validateIsBc($attribute, $value, $perameters, $validator)
202 202
     {
203 203
         foreach ($validator->getData() as $data) {
204
-            $identityType = Identity_type::where('national_code', 'like', '%' . $data['identity_type'] . '%')->first();
204
+            $identityType = Identity_type::where('national_code', 'like', '%'.$data['identity_type'].'%')->first();
205 205
             if (($identityType !== null) && ($identityType !== "")) {
206 206
                 if (($identityType->national_code) === 'BC') {
207 207
                     return (strlen((string) $data['identity_number']) < 7);
208
-                } else {
208
+                }else {
209 209
                     return true;
210 210
                 }
211
-            } else {
211
+            }else {
212 212
                 return true;
213 213
             }
214 214
         }
@@ -218,24 +218,24 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $isUnique = Security_user::where('identity_number', '=', $value)->where('identity_type_id', '=', $identityType->id);
220 220
         if ($isUnique->count() > 0) {
221
-            $this->_custom_messages['user_unique'] = 'The identity number already in use. User ID is : ' . $isUnique->first()->openemis_no;
221
+            $this->_custom_messages['user_unique'] = 'The identity number already in use. User ID is : '.$isUnique->first()->openemis_no;
222 222
             $this->_set_custom_stuff();
223 223
             return false;
224
-        } else {
224
+        }else {
225 225
             return true;
226 226
         }
227 227
     }
228 228
 
229 229
     protected function IsBc($data, $value)
230 230
     {
231
-        $identityType = Identity_type::where('national_code', 'like', '%' . $data['identity_type'] . '%')->first();
231
+        $identityType = Identity_type::where('national_code', 'like', '%'.$data['identity_type'].'%')->first();
232 232
         if ($identityType !== null) {
233 233
             if (($identityType->national_code) === 'BC' && strlen((string) $value) < 8) {
234 234
                 return false;
235
-            } else {
235
+            }else {
236 236
                 return true;
237 237
             }
238
-        } else {
238
+        }else {
239 239
             return true;
240 240
         }
241 241
     }
Please login to merge, or discard this patch.
app/Http/Controllers/BulkPromotion.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
             if (!empty($isAvailableforPromotion)) {
64 64
                 $this->process($institutionGrade, $nextGrade, $year, 1);
65
-            } else {
65
+            }else {
66 66
                 $this->process($institutionGrade, $nextGrade, $year, 3);
67 67
             }
68 68
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
             $output = new \Symfony\Component\Console\Output\ConsoleOutput();
98 98
             $output->writeln('##########################################################################################################################');
99
-            $output->writeln('Promoting from ' . $institutionGrade['name'] . ' IN ' . $institution->name . ' No of Students: ' . count($studentListToPromote));
99
+            $output->writeln('Promoting from '.$institutionGrade['name'].' IN '.$institution->name.' No of Students: '.count($studentListToPromote));
100 100
 
101 101
 
102 102
             if (!empty($parallelClasses)) {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 array_walk($studentListToPromote, array($this, 'assingeToClasses'), $params);
111 111
                 array_walk($parallelClasses, array($this, 'updateStudentCount'));
112 112
             }
113
-        } catch (\Exception $e) {
113
+        }catch (\Exception $e) {
114 114
             dd($e);
115 115
             Log::error($e->getMessage());
116 116
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $nextAcademicPeriod = Academic_period::query()->where('code', $year)->get()->first();
146 146
 
147 147
         $nextGradeObj = null;
148
-        if ($nextGrade !== []  && !is_null($nextGrade)) {
148
+        if ($nextGrade !== [] && !is_null($nextGrade)) {
149 149
             $currentGradeObj = $this->instituion_grade->getParallelClasses($institutionGrade['id'], $institutionGrade['institution_id'], $institutionGrade['education_grade_id'], $academicPeriod->id);
150 150
             $nextGradeObj = $this->instituion_grade->getParallelClasses($institutionGrade['id'], $institutionGrade['institution_id'], $nextGrade->id, $nextAcademicPeriod->id);
151 151
         }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 // promote parallel classes
156 156
                 $this->promotion($institutionGrade, $nextGrade, $academicPeriod, $nextAcademicPeriod, $nextGradeObj->toArray(), 1);
157 157
                 return 1;
158
-            } elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !==  $currentGradeObj->count())) {
158
+            } elseif (($nextGradeObj->count() > 1) && ($nextGradeObj->count() !== $currentGradeObj->count())) {
159 159
                 // promote pool promotion
160 160
                 $this->promotion($institutionGrade, $nextGrade, $academicPeriod, $nextAcademicPeriod, [], 1);
161 161
                 return 2;
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
                 // Promote matching class name with previous class
164 164
                 $this->promotion($institutionGrade, $nextGrade, $academicPeriod, $nextAcademicPeriod, $nextGradeObj->toArray(), 1);
165 165
                 return 1;
166
-            } else {
166
+            }else {
167 167
                 // default pool promotion
168 168
                 $this->promotion($institutionGrade, $nextGrade, $academicPeriod, $nextAcademicPeriod, [], 1);
169 169
                 return 2;
170 170
             }
171
-        } else {
171
+        }else {
172 172
             // default pool promotion
173 173
             $this->promotion($institutionGrade, $nextGrade, $academicPeriod, $nextAcademicPeriod, [], 3);
174 174
             return 2;
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
         ];
205 205
 
206 206
         try {
207
-            Institution_student::where('id', (string)$student['id'])->update($studentData);
207
+            Institution_student::where('id', (string) $student['id'])->update($studentData);
208 208
             $output = new \Symfony\Component\Console\Output\ConsoleOutput();
209
-            $output->writeln('----------------- ' . $student['admission_id'] . ' to ' . $studentData['education_grade_id']);
210
-        } catch (\Exception $e) {
209
+            $output->writeln('----------------- '.$student['admission_id'].' to '.$studentData['education_grade_id']);
210
+        }catch (\Exception $e) {
211 211
             dd($e);
212 212
             Log::error($e->getMessage());
213 213
         }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         $studentClass = $this->institution_class_students->getStudentNewClass($student);
229 229
         if (!is_null($studentClass)) {
230 230
             return  array_search(str_replace($educationGrade['name'], $nextGrade->name, $studentClass->name), array_column($classes, 'name'));
231
-        } else {
231
+        }else {
232 232
             return false;
233 233
         }
234 234
     }
@@ -280,11 +280,11 @@  discard block
 block discarded – undo
280 280
                 if (!$this->institution_class_students->isDuplicated($studentObj)) {
281 281
                     $this->institution_class_students->create($studentObj);
282 282
                     $output = new \Symfony\Component\Console\Output\ConsoleOutput();
283
-                    $output->writeln('----------------- ' . $student['student_id'] . 'to ' . $class['name']);
284
-                } else {
285
-                    $this->institution_class_students->where('id', (string)$student['id'])->update($studentObj);
283
+                    $output->writeln('----------------- '.$student['student_id'].'to '.$class['name']);
284
+                }else {
285
+                    $this->institution_class_students->where('id', (string) $student['id'])->update($studentObj);
286 286
                     $output = new \Symfony\Component\Console\Output\ConsoleOutput();
287
-                    $output->writeln('----------------- ' . $student['student_id'] . 'to ' . $class['name']);
287
+                    $output->writeln('----------------- '.$student['student_id'].'to '.$class['name']);
288 288
                 }
289 289
             }
290 290
         }
Please login to merge, or discard this patch.
app/Http/Controllers/DashboardViewsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 class DashboardViewsController extends Controller
9 9
 {
10 10
     
11
-    public function callback(){
11
+    public function callback() {
12 12
         
13 13
         /** Total number of students by institutions
14 14
          *  In Grafana query to get total students count 
Please login to merge, or discard this patch.
app/Imports/ExaminationStudentsImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 use Maatwebsite\Excel\Concerns\WithBatchInserts;
19 19
 use Maatwebsite\Excel\Concerns\WithChunkReading;
20 20
 
21
-class ExaminationStudentsImport implements ToModel, WithStartRow, WithHeadingRow, WithChunkReading, WithBatchInserts , WithValidation ,WithMapping, SkipsOnFailure, SkipsOnError
21
+class ExaminationStudentsImport implements ToModel, WithStartRow, WithHeadingRow, WithChunkReading, WithBatchInserts, WithValidation, WithMapping, SkipsOnFailure, SkipsOnError
22 22
 {
23
-    use Importable , SkipsFailures, SkipsErrors;
23
+    use Importable, SkipsFailures, SkipsErrors;
24 24
 
25 25
     /**
26 26
      * @return int
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
 
58 58
     private function transformDateTime(string $value, string $format = 'm/d/Y')
59 59
     {
60
-        try{
60
+        try {
61 61
             $date = date_create_from_format('m/d/Y', $value);
62
-            if(gettype($date)=='boolean'){
62
+            if (gettype($date) == 'boolean') {
63 63
                 $date = date_create_from_format('Y-m-d', $value);
64 64
             }
65 65
             $date = date_format($date, 'Y-m-d');
66 66
             return  $date;
67
-        }catch(\Exception $e){
67
+        }catch (\Exception $e) {
68 68
             $error = \Illuminate\Validation\ValidationException::withMessages([]);
69 69
             $failure = new Failure(2, 'remark', [0 => 'The given date is wrong']);
70 70
             $failures = [0 => $failure];
Please login to merge, or discard this patch.