Completed
Push — master ( 35dd53...18ebf0 )
by claudio
09:19 queued 12s
created
app/Console/Commands/Optimise/OptimiseCommand.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -58,10 +58,11 @@  discard block
 block discarded – undo
58 58
         //TODO insert a timeout
59 59
         //TODO try...catch with destruct
60 60
         $companyId = $this->argument('companyId');
61
-        if (is_numeric($companyId))
62
-            $this->makeForeground(Company::findOrFail($companyId));
63
-        else
64
-            $this->syncAll();
61
+        if (is_numeric($companyId)) {
62
+                    $this->makeForeground(Company::findOrFail($companyId));
63
+        } else {
64
+                    $this->syncAll();
65
+        }
65 66
     }
66 67
 
67 68
     /**
@@ -81,13 +82,15 @@  discard block
 block discarded – undo
81 82
         if ($this->option('background')) {
82 83
             \Log::debug(self::BACKGROUND_MOD_MEX);
83 84
             $this->info(self::BACKGROUND_MOD_MEX);
84
-            foreach ($companies as $company)
85
-                $this->makeBackground($company);
85
+            foreach ($companies as $company) {
86
+                            $this->makeBackground($company);
87
+            }
86 88
             \Log::debug(self::BACKGROUND_COMPLETED_MEX);
87 89
             $this->info(self::BACKGROUND_COMPLETED_MEX);
88
-        } else
89
-            foreach ($companies as $company)
90
+        } else {
91
+                    foreach ($companies as $company)
90 92
                 $this->makeForeground($company);
93
+        }
91 94
     }
92 95
 
93 96
     /**
@@ -97,7 +100,8 @@  discard block
 block discarded – undo
97 100
     private function makeBackground(Company $company)
98 101
     {
99 102
         $event = $this->schedule->command('optimise:meetings ' . $company->id)->withoutOverlapping();
100
-        if ($event->isDue($this->laravel))
101
-            $event->run($this->laravel);
103
+        if ($event->isDue($this->laravel)) {
104
+                    $event->run($this->laravel);
105
+        }
102 106
     }
103 107
 }
Please login to merge, or discard this patch.