@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function register() |
21 | 21 | { |
22 | - $this->app->singleton('record', function ($app) { |
|
22 | + $this->app->singleton('record', function($app) { |
|
23 | 23 | return new LogManager($app); |
24 | 24 | }); |
25 | 25 | |
26 | 26 | $this->mergeConfigFrom( |
27 | - __DIR__.'/../config/stethoscope.php', |
|
27 | + __DIR__ . '/../config/stethoscope.php', |
|
28 | 28 | 'stethoscope' |
29 | 29 | ); |
30 | 30 | |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | if ($this->app->runningInConsole()) { |
42 | 42 | // publishing the config |
43 | 43 | $this->publishes([ |
44 | - __DIR__.'/../config/stethoscope.php' => config_path('stethoscope.php'), |
|
44 | + __DIR__ . '/../config/stethoscope.php' => config_path('stethoscope.php'), |
|
45 | 45 | ], 'stethoscope-publish-config'); |
46 | 46 | |
47 | 47 | // publishing the build files |
48 | 48 | $this->publishes([ |
49 | - __DIR__.'/../public/build' => public_path('vendor/stethoscope'), |
|
49 | + __DIR__ . '/../public/build' => public_path('vendor/stethoscope'), |
|
50 | 50 | ], 'stethoscope-publish-view'); |
51 | 51 | |
52 | 52 | $this->commands([ |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | ]); |
57 | 57 | } |
58 | 58 | |
59 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
59 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
60 | 60 | |
61 | - $this->loadRoutesFrom(__DIR__.'/../routes/api.php'); |
|
62 | - $this->loadRoutesFrom(__DIR__.'/../routes/web.php'); |
|
61 | + $this->loadRoutesFrom(__DIR__ . '/../routes/api.php'); |
|
62 | + $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); |
|
63 | 63 | |
64 | - $this->loadViewsFrom(__DIR__.'/../resources/views', 'mohsenabrishami'); |
|
64 | + $this->loadViewsFrom(__DIR__ . '/../resources/views', 'mohsenabrishami'); |
|
65 | 65 | |
66 | - $this->app['router']->aliasMiddleware('check.access.to.monitoring.panel', CheckAccessToMonitoringPanel::class); |
|
66 | + $this->app[ 'router' ]->aliasMiddleware('check.access.to.monitoring.panel', CheckAccessToMonitoringPanel::class); |
|
67 | 67 | } |
68 | 68 | } |
@@ -66,6 +66,6 @@ |
||
66 | 66 | */ |
67 | 67 | public function webServerMessage($webServerStatus) |
68 | 68 | { |
69 | - return 'web server status ===> '.$webServerStatus; |
|
69 | + return 'web server status ===> ' . $webServerStatus; |
|
70 | 70 | } |
71 | 71 | } |
@@ -11,10 +11,10 @@ |
||
11 | 11 | |
12 | 12 | public function definition() |
13 | 13 | { |
14 | - $resources = ['cpu', 'memory', 'storage', 'network', 'webServer']; |
|
14 | + $resources = [ 'cpu', 'memory', 'storage', 'network', 'webServer' ]; |
|
15 | 15 | |
16 | 16 | return [ |
17 | - 'resource' => $resources[random_int(0, 4)], |
|
17 | + 'resource' => $resources[ random_int(0, 4) ], |
|
18 | 18 | 'log' => $this->faker->text(), |
19 | 19 | ]; |
20 | 20 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public function check(): string |
11 | 11 | { |
12 | - foreach(config('stethoscope.network_monitor_url') as $networkMonitorURL){ |
|
12 | + foreach (config('stethoscope.network_monitor_url') as $networkMonitorURL) { |
|
13 | 13 | try { |
14 | 14 | Http::get($networkMonitorURL)->successful(); |
15 | 15 | $networkConnction = 'connected'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function handle() |
47 | 47 | { |
48 | - $resourceReports = []; |
|
48 | + $resourceReports = [ ]; |
|
49 | 49 | |
50 | 50 | $cpuUsage = $this->cpu->check(); |
51 | 51 | $memoryUsage = $this->memory->check(); |
@@ -54,28 +54,28 @@ discard block |
||
54 | 54 | $webServerStatuses = $this->webServer->check(); |
55 | 55 | |
56 | 56 | if (config('stethoscope.monitorable_resources.cpu') && $cpuUsage > config(('stethoscope.thresholds.cpu'))) { |
57 | - $resourceReports['cpu'] = $cpuUsage; |
|
57 | + $resourceReports[ 'cpu' ] = $cpuUsage; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($memoryUsage > config(('stethoscope.thresholds.memory')) && config('stethoscope.monitorable_resources.memory')) { |
61 | - $resourceReports['memory'] = $memoryUsage; |
|
61 | + $resourceReports[ 'memory' ] = $memoryUsage; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($networkStatus == 'disconnected' && config('stethoscope.monitorable_resources.network')) { |
65 | - $resourceReports['network'] = $networkStatus; |
|
65 | + $resourceReports[ 'network' ] = $networkStatus; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($storageFreeSpace < config(('stethoscope.thresholds.storage')) && config('stethoscope.monitorable_resources.storage')) { |
69 | - $resourceReports['storage'] = $storageFreeSpace; |
|
69 | + $resourceReports[ 'storage' ] = $storageFreeSpace; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($webServerStatuses != 'active' && config('stethoscope.monitorable_resources.web_server')) { |
73 | - $resourceReports['webServer'] = $webServerStatuses; |
|
73 | + $resourceReports[ 'webServer' ] = $webServerStatuses; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | Record::record($resourceReports); |
77 | 77 | |
78 | - if (! empty($resourceReports)) { |
|
78 | + if (!empty($resourceReports)) { |
|
79 | 79 | TroubleOccurred::dispatch($resourceReports); |
80 | 80 | } |
81 | 81 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | | |
72 | 72 | */ |
73 | 73 | |
74 | - 'network_monitor_url' => env('NETWORK_MONITOR_URL', ['https://1.1.1.1/', 'https://www.google.com/']), |
|
74 | + 'network_monitor_url' => env('NETWORK_MONITOR_URL', [ 'https://1.1.1.1/', 'https://www.google.com/' ]), |
|
75 | 75 | |
76 | 76 | /* |
77 | 77 | |-------------------------------------------------------------------------- |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | 'notifications' => [ |
107 | 107 | |
108 | 108 | 'notifications' => [ |
109 | - \MohsenAbrishami\Stethoscope\Notifications\LogReportNotification::class => ['mail'], |
|
109 | + \MohsenAbrishami\Stethoscope\Notifications\LogReportNotification::class => [ 'mail' ], |
|
110 | 110 | ], |
111 | 111 | |
112 | 112 | 'notifiable' => \MohsenAbrishami\Stethoscope\Notifications\Notifiable::class, |