Test Setup Failed
Pull Request — master (#261)
by Mohamed
06:38
created
app/Mail/StudentCountExceeded.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
         $institution = Institution_class::find($file['institution_class_id']);
32 32
 
33 33
         $this->user = User::find($file['security_user_id']);
34
-        $this->subject = 'SIS Bulk Upload: Upload Failed '.$institution->institution->code.': '. $institution->name . date('Y:m:d H:i:s');
34
+        $this->subject = 'SIS Bulk Upload: Upload Failed '.$institution->institution->code.': '.$institution->name.date('Y:m:d H:i:s');
35 35
         $this->from_address = env('MAIL_FROM_ADDRESS');
36 36
         $this->from_name = 'SIS Bulk Uploader';
37 37
         $this->with = [
38 38
             'name' => $this->user->first_name,
39
-            'link' =>   env('APP_ENV','local') == 'stage' | 'local' | 'prod'  ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
39
+            'link' =>   env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
40 40
         ];
41 41
         $this->viewData = [
42 42
             'name'=>$this->user->first_name, "body" => "The class you tried to import data is exceeded the student count limit.Please check the class / increase the student limit",
43
-            'link' =>   env('APP_ENV','local') == 'stage' | 'local' | 'prod'  ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
43
+            'link' =>   env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
44 44
         ];
45 45
     }
46 46
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     public function build()
53 53
     {
54 54
         return $this->view('emails.mail')
55
-            ->from($this->from_address,$this->from_name)
55
+            ->from($this->from_address, $this->from_name)
56 56
             ->to($this->user->email)
57 57
             ->subject($this->subject)
58 58
             ->with($this->with);
Please login to merge, or discard this patch.
app/Mail/IncorrectTemplate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 
24 24
 
25 25
         $this->user = User::find($file['security_user_id']);
26
-        $this->subject = 'SIS Bulk Upload: IncorrectTemplate'.$institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s');
26
+        $this->subject = 'SIS Bulk Upload: IncorrectTemplate'.$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s');
27 27
         $this->from_address = env('MAIL_FROM_ADDRESS');
28 28
         $this->from_name = 'SIS Bulk Uploader';
29 29
         $this->with = [
30 30
             'name' => $this->user->first_name,
31
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
31
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
32 32
         ];
33 33
         $this->viewData = [
34 34
             'name'=>$this->user->first_name, "body" => "The Template you used for upload having some issues, please reconfirm and re-upload with correct template",
35
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
35
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
36 36
         ];
37 37
     }
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function build()
45 45
     {
46 46
         return $this->view('emails.mail')
47
-            ->from($this->from_address,$this->from_name)
47
+            ->from($this->from_address, $this->from_name)
48 48
             ->to($this->user->email)
49 49
             ->subject($this->subject)
50 50
             ->with($this->with);
Please login to merge, or discard this patch.
app/Mail/StudentImportFailure.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,17 +24,17 @@  discard block
 block discarded – undo
24 24
 
25 25
 
26 26
         $this->user = User::find($file['security_user_id']);
27
-        $this->subject = 'SIS Bulk Upload: ' .$file['subject']. $institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s');
27
+        $this->subject = 'SIS Bulk Upload: '.$file['subject'].$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s');
28 28
         $this->from_address = env('MAIL_FROM_ADDRESS');
29 29
         $this->from_name = 'SIS Bulk Uploader';
30 30
         $this->with = [
31 31
             'name' => $this->user->first_name,
32
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
32
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
33 33
         ];
34 34
         $this->viewData = [
35
-            'name'=>$this->user->first_name, "body" => "We found some errors on your data file ". $file['filename']. ' Pleas fix the errors and re-upload  only with incorrect data,
35
+            'name'=>$this->user->first_name, "body" => "We found some errors on your data file ".$file['filename'].' Pleas fix the errors and re-upload  only with incorrect data,
36 36
             We uploaded the correct data to the system',
37
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod'  ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
37
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
38 38
         ];
39 39
     }
40 40
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function build()
47 47
     {
48 48
         return $this->view('emails.mail')
49
-            ->from($this->from_address,$this->from_name)
49
+            ->from($this->from_address, $this->from_name)
50 50
             ->to($this->user->email)
51 51
             ->subject($this->subject)
52 52
             ->with($this->with);
Please login to merge, or discard this patch.
app/Mail/EmptyFile.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
         $this->user = User::find($file['security_user_id']);
28
-        $this->subject = 'SIS Bulk Upload: ' .$file['subject'].' Empty ' . $institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s');
28
+        $this->subject = 'SIS Bulk Upload: '.$file['subject'].' Empty '.$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s');
29 29
         $this->from_address = env('MAIL_FROM_ADDRESS');
30 30
         $this->from_name = 'SIS Bulk Uploader';
31 31
         $this->with = [
32 32
             'name' => $this->user->first_name,
33
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL') : env('APP_URL').'bulk-upload/'
33
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL') : env('APP_URL').'bulk-upload/'
34 34
         ];
35 35
         $this->viewData = [
36
-            'name'=>$this->user->first_name, "body" => "No data Found in ". $file['filename']. ' Please re-upload the file with data',
37
-            'link' =>  env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL') : env('APP_URL').'bulk-upload/'
36
+            'name'=>$this->user->first_name, "body" => "No data Found in ".$file['filename'].' Please re-upload the file with data',
37
+            'link' =>  env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL') : env('APP_URL').'bulk-upload/'
38 38
         ];
39 39
     }
40 40
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function build()
47 47
     {
48 48
         return $this->view('emails.mail')
49
-            ->from($this->from_address,$this->from_name)
49
+            ->from($this->from_address, $this->from_name)
50 50
             ->to($this->user->email)
51 51
             ->subject($this->subject)
52 52
             ->with($this->with);
Please login to merge, or discard this patch.
app/Mail/TerminatedReport.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
 
23 23
         $institution = Institution_class::find($file['institution_class_id']);
24 24
         $this->user = User::find($file['security_user_id']);
25
-        $this->subject = 'SIS Bulk Upload: Process Terminated'.$institution->institution->code.': '. $institution->name.' '. date('Y:m:d H:i:s');
25
+        $this->subject = 'SIS Bulk Upload: Process Terminated'.$institution->institution->code.': '.$institution->name.' '.date('Y:m:d H:i:s');
26 26
         $this->from_address = env('MAIL_FROM_ADDRESS');
27 27
         $this->from_name = 'SIS Bulk Uploader';
28 28
         $this->with = [
29 29
             'name' => $this->user->first_name,
30
-            'link' =>   env('APP_ENV','local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
30
+            'link' =>   env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
31 31
         ];
32 32
         $this->viewData = [
33 33
             'name'=>$this->user->first_name, "body" => "Apologize ,The process of you file has been terminated in the middle,
34 34
              We advice you to check the student data and re-upload with only with correct data which are not in the system ",
35
-            'link' =>    env('APP_ENV','local') == 'stage' | 'local' | 'prod'  ?  env('APP_URL').'/download/' .$file['filename'] : env('APP_URL').'/bulk-upload/download/' .$file['filename']
35
+            'link' =>    env('APP_ENV', 'local') == 'stage' | 'local' | 'prod' ?  env('APP_URL').'/download/'.$file['filename'] : env('APP_URL').'/bulk-upload/download/'.$file['filename']
36 36
         ];
37 37
     }
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function build()
45 45
     {
46 46
         return $this->view('emails.mail')
47
-            ->from($this->from_address,$this->from_name)
47
+            ->from($this->from_address, $this->from_name)
48 48
             ->to($this->user->email)
49 49
             ->subject($this->subject)
50 50
             ->with($this->with);
Please login to merge, or discard this patch.
app/Models/Institution_student_admission.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,12 +67,12 @@
 block discarded – undo
67 67
                 'institution_id' => $admissionInfo['instituion']->id,
68 68
                 'academic_period_id' => $admissionInfo['academic_period']->id,
69 69
                 'education_grade_id' => $admissionInfo['education_grade']->id,
70
-                'institution_class_id' => (($admissionInfo['instituion_class']  != []) && (count($admissionInfo['instituion_class'])==1)) ? $admissionInfo['instituion_class']['id'] : null,
70
+                'institution_class_id' => (($admissionInfo['instituion_class'] != []) && (count($admissionInfo['instituion_class']) == 1)) ? $admissionInfo['instituion_class']['id'] : null,
71 71
                 'comment' => 'Imported From Examination Data',
72 72
                 'created_user_id' => 1
73 73
             ];
74 74
             self::create($data);
75
-        } catch (\Throwable $th) {
75
+        }catch (\Throwable $th) {
76 76
             Log::error($th);
77 77
         }
78 78
     }
Please login to merge, or discard this patch.
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/Unique_user_id.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
     {
56 56
        try {
57 57
             // regenerate unique id if it's not available
58
-        $uniqueId =  $this->uniqueUserId::isValidUniqueId($user['openemis_no']) ? $this->uniqueUserId::getUniqueAlphanumeric() : $user['openemis_no'];
58
+        $uniqueId = $this->uniqueUserId::isValidUniqueId($user['openemis_no']) ? $this->uniqueUserId::getUniqueAlphanumeric() : $user['openemis_no'];
59 59
 
60 60
         //check if the user's entry exits ?
61 61
         $exists = Unique_user_id::where([
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 'unique_id' =>  $uniqueId
70 70
             ]);
71 71
         }
72
-       } catch (\Exception $th) {
72
+       }catch (\Exception $th) {
73 73
            Log::error($th->getMessage());
74 74
        }
75 75
     }
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.