@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @param $url |
91 | 91 | * @param $ssl |
92 | - * @return mixed|\Psr\Http\Message\ResponseInterface |
|
92 | + * @return \Psr\Http\Message\ResponseInterface |
|
93 | 93 | * @throws \GuzzleHttp\Exception\GuzzleException |
94 | 94 | */ |
95 | 95 | private function fetchResponse($url, $ssl) |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * Make a url with a proper scheme. |
161 | 161 | * |
162 | 162 | * @param $url |
163 | - * @param $secure |
|
163 | + * @param boolean $secure |
|
164 | 164 | * @return mixed |
165 | 165 | */ |
166 | 166 | private function makeUrlWithScheme($url, $secure) |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * Send a request and get the result. |
189 | 189 | * |
190 | 190 | * @param $url |
191 | - * @param $ssl |
|
191 | + * @param boolean $ssl |
|
192 | 192 | * @return bool |
193 | 193 | * @internal param $response |
194 | 194 | */ |
@@ -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 | /** |
@@ -28,7 +28,8 @@ |
||
28 | 28 | * Get hostname and IP. |
29 | 29 | * |
30 | 30 | * @param $hostname |
31 | - * @return mixed |
|
31 | + * @param boolean $ipAdress |
|
32 | + * @return string |
|
32 | 33 | */ |
33 | 34 | protected function hosnameAndIp($hostname, $ipAdress) |
34 | 35 | { |
@@ -74,7 +74,7 @@ |
||
74 | 74 | */ |
75 | 75 | protected function portIsNotConnectable($ipAddress) |
76 | 76 | { |
77 | - return ! $this->portCheck( |
|
77 | + return !$this->portCheck( |
|
78 | 78 | $ipAddress, |
79 | 79 | $this->target->port, |
80 | 80 | $this->target->timeout ?? 1 |
@@ -27,12 +27,18 @@ discard block |
||
27 | 27 | return $this->makeHealthyResult(); |
28 | 28 | } |
29 | 29 | |
30 | + /** |
|
31 | + * @param integer|null $processes |
|
32 | + */ |
|
30 | 33 | private function checkMinMax($processes) |
31 | 34 | { |
32 | 35 | return $this->buildMessage('minimum', $processes) |
33 | 36 | ?: $this->buildMessage('maximum', $processes); |
34 | 37 | } |
35 | 38 | |
39 | + /** |
|
40 | + * @param string $type |
|
41 | + */ |
|
36 | 42 | private function buildMessage($type, $processes) |
37 | 43 | { |
38 | 44 | $instances = $this->target->instances; |
@@ -75,7 +81,7 @@ discard block |
||
75 | 81 | |
76 | 82 | /** |
77 | 83 | * @param $file |
78 | - * @return bool |
|
84 | + * @return integer |
|
79 | 85 | */ |
80 | 86 | private function checkPidFileExistence($file) |
81 | 87 | { |
@@ -90,7 +96,7 @@ discard block |
||
90 | 96 | |
91 | 97 | /** |
92 | 98 | * @param $file |
93 | - * @return bool |
|
99 | + * @return boolean|null |
|
94 | 100 | */ |
95 | 101 | private function checkPidFileLockState($file) |
96 | 102 | { |
@@ -112,7 +118,7 @@ discard block |
||
112 | 118 | } |
113 | 119 | |
114 | 120 | /** |
115 | - * @return bool |
|
121 | + * @return integer |
|
116 | 122 | */ |
117 | 123 | private function processPidFileIsLocked() |
118 | 124 | { |
@@ -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 | ); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * Flush cache. |
24 | 24 | * |
25 | 25 | * @param bool $force |
26 | - * @param null $key |
|
26 | + * @param string $key |
|
27 | 27 | */ |
28 | 28 | public function flush($force = false, $key = null) |
29 | 29 | { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function flush($force = false, $key = null) |
31 | 31 | { |
32 | - if (! isset($this->flushed[$key]) && ($force || $this->needsToFlush())) { |
|
32 | + if (!isset($this->flushed[$key]) && ($force || $this->needsToFlush())) { |
|
33 | 33 | try { |
34 | 34 | $this->forceFlush($key); |
35 | 35 | } catch (Exception $exception) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function remember($key, \Closure $callback) |
125 | 125 | { |
126 | - if (! $this->cacheIsEnabled()) { |
|
126 | + if (!$this->cacheIsEnabled()) { |
|
127 | 127 | return $callback(); |
128 | 128 | } |
129 | 129 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Get enabled resources. |
35 | 35 | * |
36 | - * @param $resources |
|
36 | + * @param \Illuminate\Support\Collection $resources |
|
37 | 37 | * @return \Illuminate\Support\Collection |
38 | 38 | * @throws \Exception |
39 | 39 | */ |
@@ -105,6 +105,7 @@ discard block |
||
105 | 105 | /** |
106 | 106 | * Replace executable code. |
107 | 107 | * |
108 | + * @param \Illuminate\Support\Collection $files |
|
108 | 109 | * @return \Illuminate\Support\Collection |
109 | 110 | */ |
110 | 111 | private function replaceExecutableCode($files) |
@@ -175,7 +176,7 @@ discard block |
||
175 | 176 | /** |
176 | 177 | * Sanitize resources. |
177 | 178 | * |
178 | - * @param $resources |
|
179 | + * @param \Illuminate\Support\Collection $resources |
|
179 | 180 | * @return \Illuminate\Support\Collection |
180 | 181 | */ |
181 | 182 | private function sanitizeResources($resources) |
@@ -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 | }); |
@@ -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 | ) { |
@@ -37,6 +37,9 @@ discard block |
||
37 | 37 | return ! class_exists(ApiClient::class); |
38 | 38 | } |
39 | 39 | |
40 | + /** |
|
41 | + * @param \DocuSign\eSign\Model\LoginInformation $login |
|
42 | + */ |
|
40 | 43 | private function getAccountIdFromLogin($login) |
41 | 44 | { |
42 | 45 | return $login->getLoginAccounts()[0]->getAccountId(); |
@@ -80,7 +83,7 @@ discard block |
||
80 | 83 | } |
81 | 84 | |
82 | 85 | /** |
83 | - * @param $config |
|
86 | + * @param ApiClient $config |
|
84 | 87 | * @return \DocuSign\eSign\Model\LoginInformation |
85 | 88 | */ |
86 | 89 | protected function getLoginInformation($config) |
@@ -106,6 +109,9 @@ discard block |
||
106 | 109 | ); |
107 | 110 | } |
108 | 111 | |
112 | + /** |
|
113 | + * @return string |
|
114 | + */ |
|
109 | 115 | private function makeFileName($file) |
110 | 116 | { |
111 | 117 | if (is_absolute_path($file)) { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | return $this->makeResult(false, $this->target->notInstalledMessage); |
21 | 21 | } |
22 | 22 | |
23 | - if (! $this->login()) { |
|
23 | + if (!$this->login()) { |
|
24 | 24 | throw new DomainException( |
25 | 25 | 'Unable to authenticate to the DocuSign Api' |
26 | 26 | ); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | private function docusignIsNotInstalled() |
33 | 33 | { |
34 | - return ! class_exists(ApiClient::class); |
|
34 | + return !class_exists(ApiClient::class); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | private function getAccountIdFromLogin($login) |
@@ -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 |
@@ -47,6 +47,9 @@ |
||
47 | 47 | return config('health.database.enabled'); |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param \PragmaRX\Health\Support\Target $target |
|
52 | + */ |
|
50 | 53 | protected function saveResultsToDatabase($target, $result) |
51 | 54 | { |
52 | 55 | $model = config('health.database.model', HealthCheck::class); |