@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | foreach ($resources as $url) { |
| 49 | 49 | [$healthy, $message] = $this->checkHealthPanel($url); |
| 50 | 50 | |
| 51 | - if (! $healthy) { |
|
| 51 | + if (!$healthy) { |
|
| 52 | 52 | return $this->makeResult(false, $message); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $urls = $this->target->urls; |
| 72 | 72 | |
| 73 | - if (! is_a($urls, Collection::class)) { |
|
| 73 | + if (!is_a($urls, Collection::class)) { |
|
| 74 | 74 | $urls = collect($urls); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | foreach ($resources as $resource) { |
| 112 | 112 | foreach ($resource['targets'] as $target) { |
| 113 | - if (! $target['result']['healthy']) { |
|
| 113 | + if (!$target['result']['healthy']) { |
|
| 114 | 114 | $messages[] = "{$resource['name']}: failing."; |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $parameters |
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | - if (! $healthy) { |
|
| 51 | + if (!$healthy) { |
|
| 52 | 52 | return $this->makeResult($healthy, $message); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | private function onStatsCallback() |
| 197 | 197 | { |
| 198 | - return function (TransferStats $stats) { |
|
| 198 | + return function(TransferStats $stats) { |
|
| 199 | 199 | $this->totalTime = $stats->getTransferTime(); |
| 200 | 200 | }; |
| 201 | 201 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | protected function getMethod($parameters) |
| 271 | 271 | { |
| 272 | - if (! isset($parameters['method'])) { |
|
| 272 | + if (!isset($parameters['method'])) { |
|
| 273 | 273 | return 'GET'; |
| 274 | 274 | } |
| 275 | 275 | |
@@ -206,7 +206,7 @@ |
||
| 206 | 206 | public function check($action = 'resource', $caller = 'console') |
| 207 | 207 | { |
| 208 | 208 | $this->setCurrentAction($action) |
| 209 | - ->setCurrentCaller($caller) |
|
| 209 | + ->setCurrentCaller($caller) |
|
| 210 | 210 | ->targets->each(function ( |
| 211 | 211 | Target $target |
| 212 | 212 | ) { |
@@ -169,12 +169,12 @@ discard block |
||
| 169 | 169 | $current = collect(); |
| 170 | 170 | |
| 171 | 171 | $targets = $targets |
| 172 | - ->map(function (Collection $targetList) { |
|
| 173 | - return $targetList->map(function ($target, $name) { |
|
| 172 | + ->map(function(Collection $targetList) { |
|
| 173 | + return $targetList->map(function($target, $name) { |
|
| 174 | 174 | return Target::factory($this, $target, $name); |
| 175 | 175 | }); |
| 176 | 176 | }) |
| 177 | - ->reduce(function ($current, $targetList) { |
|
| 177 | + ->reduce(function($current, $targetList) { |
|
| 178 | 178 | foreach ($targetList as $target) { |
| 179 | 179 | $current[] = $target; |
| 180 | 180 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | $this->setCurrentAction($action) |
| 209 | 209 | ->setCurrentCaller($caller) |
| 210 | - ->targets->each(function ( |
|
| 210 | + ->targets->each(function( |
|
| 211 | 211 | Target $target |
| 212 | 212 | ) { |
| 213 | 213 | $target->check($target); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function isHealthy() |
| 238 | 238 | { |
| 239 | - return $this->targets->reduce(function ($carry, $target) { |
|
| 239 | + return $this->targets->reduce(function($carry, $target) { |
|
| 240 | 240 | return $carry && $target->result->healthy; |
| 241 | 241 | }, true); |
| 242 | 242 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | public function getStatus() |
| 250 | 250 | { |
| 251 | 251 | $exitCode = Commands::EXIT_CODES[result::OK]; |
| 252 | - $this->targets->each(function ($target) use (&$exitCode) { |
|
| 252 | + $this->targets->each(function($target) use (&$exitCode) { |
|
| 253 | 253 | // Handles exit codes based on the result's status. |
| 254 | 254 | $thisStatus = $target->result->getStatus(); |
| 255 | 255 | $thisExitCode = Commands::EXIT_CODES[$thisStatus]; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | protected function keysToCamel($array) |
| 266 | 266 | { |
| 267 | - return collect($array)->mapWithKeys(function ($item, $key) { |
|
| 267 | + return collect($array)->mapWithKeys(function($item, $key) { |
|
| 268 | 268 | return [Str::camel($key) => $item]; |
| 269 | 269 | }); |
| 270 | 270 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | protected function sendNotifications() |
| 288 | 288 | { |
| 289 | - return collect(config('health.notifications.channels'))->each(function ( |
|
| 289 | + return collect(config('health.notifications.channels'))->each(function( |
|
| 290 | 290 | $channel |
| 291 | 291 | ) { |
| 292 | 292 | try { |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | protected function canNotify() |
| 306 | 306 | { |
| 307 | 307 | return |
| 308 | - ! $this->notified && |
|
| 308 | + !$this->notified && |
|
| 309 | 309 | $this->notificationsAreEnabled() && |
| 310 | - ! $this->isHealthy(); |
|
| 310 | + !$this->isHealthy(); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -92,21 +92,21 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function checkResources($force = false) |
| 94 | 94 | { |
| 95 | - if (! ($resources = $this->getCachedResources($force))->isEmpty()) { |
|
| 95 | + if (!($resources = $this->getCachedResources($force))->isEmpty()) { |
|
| 96 | 96 | return $resources; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! $this->allResourcesAreGood()) { |
|
| 99 | + if (!$this->allResourcesAreGood()) { |
|
| 100 | 100 | return $this->resources = collect(); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $resources = $this->sortResources( |
| 104 | 104 | $this->getNonGlobalResources() |
| 105 | - ->each(function ($resource) { |
|
| 105 | + ->each(function($resource) { |
|
| 106 | 106 | $this->checkResource($resource); |
| 107 | 107 | }) |
| 108 | 108 | ->merge( |
| 109 | - $this->getGlobalResources()->each(function ($resource) { |
|
| 109 | + $this->getGlobalResources()->each(function($resource) { |
|
| 110 | 110 | return $resource->checkGlobal($this->getResources()); |
| 111 | 111 | }) |
| 112 | 112 | ) |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ? $resource |
| 133 | 133 | : $this->getResourceBySlug($resource); |
| 134 | 134 | |
| 135 | - $checked = $this->cache->remember($resource->slug, function () use ( |
|
| 135 | + $checked = $this->cache->remember($resource->slug, function() use ( |
|
| 136 | 136 | $resource |
| 137 | 137 | ) { |
| 138 | 138 | return $resource->check($this->getCurrentAction(), $this->getCurrentCaller()); |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | protected function allResourcesAreGood() |
| 195 | 195 | { |
| 196 | - return ! $this->getResources() |
|
| 197 | - ->reject(function ($resource) { |
|
| 198 | - return ! $resource instanceof Resource; |
|
| 196 | + return !$this->getResources() |
|
| 197 | + ->reject(function($resource) { |
|
| 198 | + return !$resource instanceof Resource; |
|
| 199 | 199 | }) |
| 200 | 200 | ->isEmpty(); |
| 201 | 201 | } |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | protected function getNonGlobalResources() |
| 211 | 211 | { |
| 212 | - return $this->getResources()->filter(function (Resource $resource) { |
|
| 213 | - return ! $resource->isGlobal; |
|
| 212 | + return $this->getResources()->filter(function(Resource $resource) { |
|
| 213 | + return !$resource->isGlobal; |
|
| 214 | 214 | }); |
| 215 | 215 | } |
| 216 | 216 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function getGlobalResources() |
| 225 | 225 | { |
| 226 | - return $this->getResources()->filter(function (Resource $resource) { |
|
| 226 | + return $this->getResources()->filter(function(Resource $resource) { |
|
| 227 | 227 | return $resource->isGlobal; |
| 228 | 228 | }); |
| 229 | 229 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ? $exception->getMessage() |
| 257 | 257 | : static::UNKNOWN_ERROR; |
| 258 | 258 | |
| 259 | - if (! isset($resourceChecker)) { |
|
| 259 | + if (!isset($resourceChecker)) { |
|
| 260 | 260 | return [ |
| 261 | 261 | null, |
| 262 | 262 | [ |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | { |
| 325 | 325 | if (is_null($this->resources) || $this->resources->isEmpty()) { |
| 326 | 326 | $this->resources = $this->resourceLoader->loadResources()->map( |
| 327 | - function ($resource) { |
|
| 328 | - return $this->handleExceptions(function () use ($resource) { |
|
| 327 | + function($resource) { |
|
| 328 | + return $this->handleExceptions(function() use ($resource) { |
|
| 329 | 329 | return $this->makeResource($resource); |
| 330 | 330 | }); |
| 331 | 331 | } |
@@ -361,8 +361,8 @@ discard block |
||
| 361 | 361 | protected function sortResources($resources) |
| 362 | 362 | { |
| 363 | 363 | if ($sortBy = config('health.sort_by')) { |
| 364 | - return $resources->sortBy(function ($resource) use ($sortBy) { |
|
| 365 | - return $this->handleExceptions(function () use ( |
|
| 364 | + return $resources->sortBy(function($resource) use ($sortBy) { |
|
| 365 | + return $this->handleExceptions(function() use ( |
|
| 366 | 366 | $resource, |
| 367 | 367 | $sortBy |
| 368 | 368 | ) { |