Test Setup Failed
Pull Request — master (#610)
by Mohamed
14:20
created
app/Console/Commands/CallPromotionCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,12 +47,12 @@
 block discarded – undo
47 47
         $limit = $this->argument('limit');
48 48
         $academicPeriod = $this->academic_period->getAcademicPeriod($year);
49 49
         $previousAcademicPeriodYear = $academicPeriod->order;
50
-        $previousAcademicPeriod = Academic_period::where('order',$previousAcademicPeriodYear+1)->first();
51
-        $institutions = $this->instituion_grade->getInstitutionGradeList($previousAcademicPeriod->code,$limit);
52
-        array_walk($institutions,array($this,'callPromotion'),$year);
50
+        $previousAcademicPeriod = Academic_period::where('order', $previousAcademicPeriodYear + 1)->first();
51
+        $institutions = $this->instituion_grade->getInstitutionGradeList($previousAcademicPeriod->code, $limit);
52
+        array_walk($institutions, array($this, 'callPromotion'), $year);
53 53
     }
54 54
 
55
-    protected function callPromotion($institution,$count,$year){
56
-        $this->call('promote:students',['year' => $year,'institution' => $institution['code']]);
55
+    protected function callPromotion($institution, $count, $year) {
56
+        $this->call('promote:students', ['year' => $year, 'institution' => $institution['code']]);
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
app/Console/Commands/RemoveDuplicatedGuardians.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,16 +52,16 @@
 block discarded – undo
52 52
     }
53 53
 
54 54
     public function delete(){
55
-       try{
56
-           DB::statement("UPDATE  student_guardians t1
55
+        try{
56
+            DB::statement("UPDATE  student_guardians t1
57 57
            INNER JOIN student_guardians t2 
58 58
                set t1.deleted_at=now() 
59 59
            WHERE 
60 60
                t1.id > t2.id AND
61 61
                t1.student_id = t2.student_id AND
62 62
                t1.guardian_id = t2.guardian_id");
63
-       }catch(\Exception $e){
64
-           dd($e);
65
-       }
63
+        }catch(\Exception $e){
64
+            dd($e);
65
+        }
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
             $this->output->writeln('############### Starting delete Duplication ################');
46 46
             Student_guardian::withTrashed()->restore();
47 47
             $this->delete();
48
-            $this->end_time  = microtime(TRUE);
49
-            $this->output->writeln('The cook took ' . ($this->end_time - $this->start_time) . ' seconds to complete');
50
-        } catch (\Throwable $th) {
48
+            $this->end_time = microtime(TRUE);
49
+            $this->output->writeln('The cook took '.($this->end_time - $this->start_time).' seconds to complete');
50
+        }catch (\Throwable $th) {
51 51
         }
52 52
     }
53 53
 
54
-    public function delete(){
55
-       try{
54
+    public function delete() {
55
+       try {
56 56
            DB::statement("UPDATE  student_guardians t1
57 57
            INNER JOIN student_guardians t2 
58 58
                set t1.deleted_at=now() 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                t1.id > t2.id AND
61 61
                t1.student_id = t2.student_id AND
62 62
                t1.guardian_id = t2.guardian_id");
63
-       }catch(\Exception $e){
63
+       }catch (\Exception $e) {
64 64
            dd($e);
65 65
        }
66 66
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
                t1.id > t2.id AND
61 61
                t1.student_id = t2.student_id AND
62 62
                t1.guardian_id = t2.guardian_id");
63
-       }catch(\Exception $e){
63
+       } catch(\Exception $e){
64 64
            dd($e);
65 65
        }
66 66
     }
Please login to merge, or discard this patch.
app/Console/Commands/PromoteStudents.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@
 block discarded – undo
65 65
         $institution = $this->argument('institution');
66 66
         $academicPeriod = $this->academic_period->getAcademicPeriod($year);
67 67
         $previousAcademicPeriodYear = $academicPeriod->order;
68
-        $previousAcademicPeriod = Academic_period::where('order',$previousAcademicPeriodYear+1)->first();
69
-        $institutionGrade = $this->instituion_grade->getInstitutionGradeToPromoted($previousAcademicPeriod->code,$institution);
68
+        $previousAcademicPeriod = Academic_period::where('order', $previousAcademicPeriodYear + 1)->first();
69
+        $institutionGrade = $this->instituion_grade->getInstitutionGradeToPromoted($previousAcademicPeriod->code, $institution);
70 70
         $output->writeln('Start promoting:'.$institution);
71 71
         $params = [
72 72
             'academicPeriod' => $academicPeriod,
73 73
             'previousAcademicPeriod' => $previousAcademicPeriod
74 74
         ];
75
-        (new BulkPromotion())->callback($institutionGrade,$params);
75
+        (new BulkPromotion())->callback($institutionGrade, $params);
76 76
         $output->writeln('Finished promoting:'.$institution);
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
app/Console/Commands/CloneConfigData.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         $academicPeriod = $this->academic_period->getAcademicPeriod($year);
55 55
         $mode = $this->argument('mode') == 'AL' ? true : false; 
56 56
         $previousAcademicPeriodYear = $academicPeriod->order;
57
-        $previousAcademicPeriod = Academic_period::where('order',$previousAcademicPeriodYear+1)->first();
58
-        $shift = $this->shifts->getShiftsToClone($previousAcademicPeriod->code,$this->argument(('max')),$mode);
57
+        $previousAcademicPeriod = Academic_period::where('order', $previousAcademicPeriodYear + 1)->first();
58
+        $shift = $this->shifts->getShiftsToClone($previousAcademicPeriod->code, $this->argument(('max')), $mode);
59 59
         $params = [
60 60
             'year' => $year,
61 61
             'academic_period' => $academicPeriod,
@@ -63,17 +63,17 @@  discard block
 block discarded – undo
63 63
             'mode' => $this->argument('mode')
64 64
         ];
65 65
         $function = array($this->clone, 'process');
66
-        if(count($shift) > 0){
66
+        if (count($shift) > 0) {
67 67
             // processParallel($function,$shift, $this->argument('max'),$params);
68
-            array_walk($shift,$function,$params);
69
-        }else{
68
+            array_walk($shift, $function, $params);
69
+        }else {
70 70
             $this->output->writeln('Nothing to clone');
71 71
         }
72 72
         $this->end_time = microtime(TRUE);
73 73
 
74 74
 
75 75
         $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
76
-        $this->output->writeln('The cook took ' . ($this->end_time - $this->start_time) . ' seconds to complete');
76
+        $this->output->writeln('The cook took '.($this->end_time - $this->start_time).' seconds to complete');
77 77
         $this->output->writeln('$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$');
78 78
     }  
79 79
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         if(count($shift) > 0){
67 67
             // processParallel($function,$shift, $this->argument('max'),$params);
68 68
             array_walk($shift,$function,$params);
69
-        }else{
69
+        } else{
70 70
             $this->output->writeln('Nothing to clone');
71 71
         }
72 72
         $this->end_time = microtime(TRUE);
Please login to merge, or discard this patch.
app/Console/Commands/MapStudentArea.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function __construct()
32 32
     {
33
-        $this->output =  new \Symfony\Component\Console\Output\ConsoleOutput();
33
+        $this->output = new \Symfony\Component\Console\Output\ConsoleOutput();
34 34
         parent::__construct();
35 35
     }
36 36
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function handle()
43 43
     {
44
-        $students = Security_user::where('is_student',true)->get()->toArray();
45
-        array_walk($students,array($this,'process'));
44
+        $students = Security_user::where('is_student', true)->get()->toArray();
45
+        array_walk($students, array($this, 'process'));
46 46
     }
47 47
 
48
-    public function process($student){
48
+    public function process($student) {
49 49
         $student['student_id'] = $student['id'];
50 50
         Institution_student::updateStudentArea($student);
51
-        $this->output->writeln('area updated for student:'. $student['openemis_no']) ;
51
+        $this->output->writeln('area updated for student:'.$student['openemis_no']);
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
app/Console/Commands/cleanConfig.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,16 +48,16 @@
 block discarded – undo
48 48
         $year = $this->argument('year');
49 49
         $academicPeriod = $this->academic_period->getAcademicPeriod($year);
50 50
         $previousAcademicPeriodYear = $academicPeriod->order;
51
-        $previousAcademicPeriod = Academic_period::where('order',$previousAcademicPeriodYear+1)->first();
51
+        $previousAcademicPeriod = Academic_period::where('order', $previousAcademicPeriodYear + 1)->first();
52 52
 
53 53
         $params = [
54 54
             'academic_period' => $academicPeriod,
55 55
             'previous_academic_period' => $previousAcademicPeriod
56 56
         ];
57 57
 
58
-        if($year == '2019' || $year == '2018/19'){
58
+        if ($year == '2019' || $year == '2018/19') {
59 59
             die('Academic Year 2019 or earlier can`t be deleted');
60
-        }else{
60
+        }else {
61 61
             $this->clone->cleanConfig($params);
62 62
         }
63 63
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
         if($year == '2019' || $year == '2018/19'){
59 59
             die('Academic Year 2019 or earlier can`t be deleted');
60
-        }else{
60
+        } else{
61 61
             $this->clone->cleanConfig($params);
62 62
         }
63 63
     }
Please login to merge, or discard this patch.