Passed
Push — main ( 7d4206...0212c0 )
by mohsen
02:47
created
src/LogRecord/Drivers/FileDriver.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,9 @@
 block discarded – undo
30 30
         if ($log != '') {
31 31
             $log = $this->timeMessage() . "\n" . $log;
32 32
 
33
-            if ($this->storage->exists($file))
34
-                $log = $this->storage->get($file) . "\n \n" . $log;
33
+            if ($this->storage->exists($file)) {
34
+                            $log = $this->storage->get($file) . "\n \n" . $log;
35
+            }
35 36
 
36 37
             $this->storage->put($file, $log);
37 38
         }
Please login to merge, or discard this patch.
src/Services/WebServer.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,11 @@
 block discarded – undo
8 8
 
9 9
     public function check(): string
10 10
     {
11
-        if (config('stethoscope.web_server_name') == 'nginx')
12
-            $this->checkNginx();
13
-        elseif (config('stethoscope.web_server_name') == 'apache')
14
-            $this->checkApache();
11
+        if (config('stethoscope.web_server_name') == 'nginx') {
12
+                    $this->checkNginx();
13
+        } elseif (config('stethoscope.web_server_name') == 'apache') {
14
+                    $this->checkApache();
15
+        }
15 16
 
16 17
         return $this->webServerStatuses;
17 18
     }
Please login to merge, or discard this patch.
src/Commands/MonitorCommand.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -54,24 +54,30 @@
 block discarded – undo
54 54
         $hardDiskFreeSpace = $this->hardDisk->check();
55 55
         $webServerStatuses = $this->webServer->check();
56 56
 
57
-        if (config('stethoscope.monitorable_resources.cpu') && $cpuUsage > config(('stethoscope.thresholds.cpu')))
58
-            $resourceReports['cpu'] = $cpuUsage;
57
+        if (config('stethoscope.monitorable_resources.cpu') && $cpuUsage > config(('stethoscope.thresholds.cpu'))) {
58
+                    $resourceReports['cpu'] = $cpuUsage;
59
+        }
59 60
 
60
-        if ($memoryUsage > config(('stethoscope.thresholds.memory')) && config('stethoscope.monitorable_resources.memory'))
61
-            $resourceReports['memory'] = $memoryUsage;
61
+        if ($memoryUsage > config(('stethoscope.thresholds.memory')) && config('stethoscope.monitorable_resources.memory')) {
62
+                    $resourceReports['memory'] = $memoryUsage;
63
+        }
62 64
 
63
-        if ($networkStatus == 'false' && config('stethoscope.monitorable_resources.network'))
64
-            $resourceReports['network'] = $networkStatus;
65
+        if ($networkStatus == 'false' && config('stethoscope.monitorable_resources.network')) {
66
+                    $resourceReports['network'] = $networkStatus;
67
+        }
65 68
 
66
-        if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk'))
67
-            $resourceReports['hardDisk'] = $hardDiskFreeSpace;
69
+        if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk')) {
70
+                    $resourceReports['hardDisk'] = $hardDiskFreeSpace;
71
+        }
68 72
 
69
-        if ($webServerStatuses != 'active' && config('stethoscope.monitorable_resources.web_server'))
70
-            $resourceReports['webServer'] = $webServerStatuses;
73
+        if ($webServerStatuses != 'active' && config('stethoscope.monitorable_resources.web_server')) {
74
+                    $resourceReports['webServer'] = $webServerStatuses;
75
+        }
71 76
 
72 77
         Record::record($resourceReports);
73 78
 
74
-        if (!empty($resourceReports))
75
-            TroubleOccurred::dispatch($resourceReports);
79
+        if (!empty($resourceReports)) {
80
+                    TroubleOccurred::dispatch($resourceReports);
81
+        }
76 82
     }
77 83
 }
Please login to merge, or discard this patch.
src/Listeners/SendResourceLogNotification.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,8 @@
 block discarded – undo
9 9
 {
10 10
     public function handle($resourceLogs)
11 11
     {
12
-        if(!is_null(config('stethoscope.notifications.mail.to')))
13
-            Mail::to(config('stethoscope.notifications.mail.to'))->send(new LogReportMail($resourceLogs));
12
+        if(!is_null(config('stethoscope.notifications.mail.to'))) {
13
+                    Mail::to(config('stethoscope.notifications.mail.to'))->send(new LogReportMail($resourceLogs));
14
+        }
14 15
     }
15 16
 }
Please login to merge, or discard this patch.