@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | private function getChecker() |
43 | 43 | { |
44 | - return function () { |
|
44 | + return function() { |
|
45 | 45 | return 'DUMMY DATA'; |
46 | 46 | }; |
47 | 47 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use PragmaRX\Health\Service; |
4 | 4 | |
5 | -if (! function_exists('instantiate')) { |
|
5 | +if (!function_exists('instantiate')) { |
|
6 | 6 | /** |
7 | 7 | * Instantiate a class. |
8 | 8 | * |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | -if (! function_exists('package_dir')) { |
|
25 | +if (!function_exists('package_dir')) { |
|
26 | 26 | /** |
27 | 27 | * Get the package root directory. |
28 | 28 | * |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | -if (! function_exists('package_resources_dir')) { |
|
39 | +if (!function_exists('package_resources_dir')) { |
|
40 | 40 | /** |
41 | 41 | * Get package resources directory. |
42 | 42 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | -if (! function_exists('is_absolute_path')) { |
|
55 | +if (!function_exists('is_absolute_path')) { |
|
56 | 56 | /** |
57 | 57 | * Check if string is absolute path. |
58 | 58 | * |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | -if (! function_exists('bytes_to_human')) { |
|
83 | +if (!function_exists('bytes_to_human')) { |
|
84 | 84 | /** |
85 | 85 | * Convert bytes to human readable. |
86 | 86 | * |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | -if (! function_exists('human_to_bytes')) { |
|
101 | +if (!function_exists('human_to_bytes')) { |
|
102 | 102 | /** |
103 | 103 | * Convert bytes to human readable. |
104 | 104 | * |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | -if (! function_exists('ip_address_from_hostname')) { |
|
129 | +if (!function_exists('ip_address_from_hostname')) { |
|
130 | 130 | function ip_address_from_hostname($host) |
131 | 131 | { |
132 | 132 | if ( |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function __getToArrayCallBack() |
48 | 48 | { |
49 | - return function ($subject) { |
|
49 | + return function($subject) { |
|
50 | 50 | static::$__depth++; |
51 | 51 | |
52 | 52 | if ($subject instanceof Arrayable) { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | private function computeHealthForAllTargets($resource) |
45 | 45 | { |
46 | - return $resource->targets->reduce(function ($carry, $target) { |
|
46 | + return $resource->targets->reduce(function($carry, $target) { |
|
47 | 47 | return $target->result->healthy; |
48 | 48 | }, true); |
49 | 49 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function isHealthy() |
57 | 57 | { |
58 | - $healthy = $this->target->resource->resources->reduce(function ( |
|
58 | + $healthy = $this->target->resource->resources->reduce(function( |
|
59 | 59 | $carry, |
60 | 60 | $item |
61 | 61 | ) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ( |
43 | 43 | is_array($filters = config($configKey = 'health.resources.enabled')) |
44 | 44 | ) { |
45 | - return collect($resources)->filter(function ($resource, $name) use ( |
|
45 | + return collect($resources)->filter(function($resource, $name) use ( |
|
46 | 46 | $filters |
47 | 47 | ) { |
48 | 48 | foreach ($filters as $filter) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function load() |
81 | 81 | { |
82 | - if (! empty($this->resources)) { |
|
82 | + if (!empty($this->resources)) { |
|
83 | 83 | return $this->resources; |
84 | 84 | } |
85 | 85 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | return $this->replaceExecutableCode( |
99 | 99 | $this->loadResourcesFiles() |
100 | - )->mapWithKeys(function ($value, $key) { |
|
100 | + )->mapWithKeys(function($value, $key) { |
|
101 | 101 | return [$this->removeExtension($key) => $value]; |
102 | 102 | }); |
103 | 103 | } |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | */ |
110 | 110 | private function replaceExecutableCode($files) |
111 | 111 | { |
112 | - return $files->map(function ($item) { |
|
112 | + return $files->map(function($item) { |
|
113 | 113 | return collect($item) |
114 | - ->map(function ($value) { |
|
114 | + ->map(function($value) { |
|
115 | 115 | return (new Resolver())->recursivelyFindAndReplaceExecutableCode( |
116 | 116 | $value |
117 | 117 | ); |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | */ |
181 | 181 | private function sanitizeResources($resources) |
182 | 182 | { |
183 | - return $resources->map(function ($resource) { |
|
184 | - return collect($resource)->mapWithKeys(function ($value, $key) { |
|
183 | + return $resources->map(function($resource) { |
|
184 | + return collect($resource)->mapWithKeys(function($value, $key) { |
|
185 | 185 | return [$this->sanitizeKey($key) => $value]; |
186 | 186 | }); |
187 | 187 | }); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function __load() |
20 | 20 | { |
21 | - if (! file_exists($file = $this->getDatabaseFileName())) { |
|
21 | + if (!file_exists($file = $this->getDatabaseFileName())) { |
|
22 | 22 | return collect(); |
23 | 23 | } |
24 | 24 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | storage_path() |
19 | 19 | ); |
20 | 20 | |
21 | - if (! file_exists($file)) { |
|
21 | + if (!file_exists($file)) { |
|
22 | 22 | return $this->makeResult( |
23 | 23 | false, |
24 | 24 | sprintf($this->target->getErrorMessage(), $file) |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | file_put_contents($file, $content); |
49 | 49 | |
50 | - register_shutdown_function(function () use ($file) { |
|
50 | + register_shutdown_function(function() use ($file) { |
|
51 | 51 | if (file_exists($file)) { |
52 | 52 | unlink($file); |
53 | 53 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | $message = $this->checkMinMax($this->getProcessesRunningCount()); |
22 | 22 | |
23 | - if (! empty($message)) { |
|
23 | + if (!empty($message)) { |
|
24 | 24 | return $this->makeResult(false, $message); |
25 | 25 | } |
26 | 26 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $instances = $this->target->instances; |
39 | 39 | |
40 | - if (! $count = (int) $instances[$type]['count']) { |
|
40 | + if (!$count = (int) $instances[$type]['count']) { |
|
41 | 41 | return ''; |
42 | 42 | } |
43 | 43 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | fclose($filePointer); |
103 | 103 | |
104 | - if (! $locked) { |
|
104 | + if (!$locked) { |
|
105 | 105 | throw new DomainException( |
106 | 106 | sprintf($this->target->pid_file_missing_not_locked, $file) |
107 | 107 | ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $this->secure |
46 | 46 | ); |
47 | 47 | |
48 | - if (! $healthy) { |
|
48 | + if (!$healthy) { |
|
49 | 49 | return $this->makeResult($healthy, $message); |
50 | 50 | } |
51 | 51 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | private function onStatsCallback() |
181 | 181 | { |
182 | - return function (TransferStats $stats) { |
|
182 | + return function(TransferStats $stats) { |
|
183 | 183 | $this->totalTime = $stats->getTransferTime(); |
184 | 184 | }; |
185 | 185 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | { |
197 | 197 | return |
198 | 198 | $this->fetchResponse($url, $ssl)->getStatusCode() == 200 && |
199 | - ! $this->requestTimedout(); |
|
199 | + !$this->requestTimedout(); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |