@@ -29,7 +29,7 @@ |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | if ($this->target->shouldReturn === false) { |
| 32 | - return ! $expressionResult; |
|
| 32 | + return !$expressionResult; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | return preg_match("|{$this->target->shouldReturn}|", $expressionResult); |
@@ -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) |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | protected function findFirstModel() |
| 35 | 35 | { |
| 36 | - collect($this->target->models)->each(function ($model) { |
|
| 36 | + collect($this->target->models)->each(function($model) { |
|
| 37 | 37 | instantiate($model)->first(); |
| 38 | 38 | }); |
| 39 | 39 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * Format input to textual table. |
| 101 | 101 | * |
| 102 | 102 | * @param Command|null $command |
| 103 | - * @param $columns |
|
| 103 | + * @param string[] $columns |
|
| 104 | 104 | * @param \Illuminate\Contracts\Support\Arrayable|array $rows |
| 105 | 105 | */ |
| 106 | 106 | private function table($command, $columns, $rows) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * Write a string as information output. |
| 115 | 115 | * |
| 116 | 116 | * @param Command|null $command |
| 117 | - * @param $string |
|
| 117 | + * @param string $string |
|
| 118 | 118 | */ |
| 119 | 119 | private function info($command, $string) |
| 120 | 120 | { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * Write a string as information output. |
| 128 | 128 | * |
| 129 | 129 | * @param Command|null $command |
| 130 | - * @param $string |
|
| 130 | + * @param string $string |
|
| 131 | 131 | */ |
| 132 | 132 | private function error($command, $string) |
| 133 | 133 | { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $columns = ['Resource', 'State', 'Message']; |
| 59 | 59 | |
| 60 | 60 | $rows = $this->getTargetsFomResources($this->healthService->health()) |
| 61 | - ->map(function ($target) { |
|
| 61 | + ->map(function($target) { |
|
| 62 | 62 | return [ |
| 63 | 63 | "{$target->resource->name} ({$target->display})", |
| 64 | 64 | $target->result->healthy |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $checker = $this->healthService->getSilentChecker(); |
| 78 | 78 | |
| 79 | - $errors = $this->getTargetsFomResources($checker()->filter(function ($resource) { |
|
| 80 | - return ! $resource->isGlobal; |
|
| 81 | - }))->reduce(function ($carry, $target) { |
|
| 79 | + $errors = $this->getTargetsFomResources($checker()->filter(function($resource) { |
|
| 80 | + return !$resource->isGlobal; |
|
| 81 | + }))->reduce(function($carry, $target) { |
|
| 82 | 82 | return $carry + ($target->result->healthy ? 0 : 1); |
| 83 | 83 | }, 0); |
| 84 | 84 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Check and get one resource. |
| 41 | 41 | * |
| 42 | - * @param $slug |
|
| 42 | + * @param string $slug |
|
| 43 | 43 | * @return mixed |
| 44 | 44 | * @throws \Exception |
| 45 | 45 | */ |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Get all resources. |
| 55 | 55 | * |
| 56 | - * @return mixed |
|
| 56 | + * @return \Illuminate\Support\Collection |
|
| 57 | 57 | * @throws \Exception |
| 58 | 58 | */ |
| 59 | 59 | public function allResources() |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function getSilentChecker() |
| 85 | 85 | { |
| 86 | - return function () { |
|
| 86 | + return function() { |
|
| 87 | 87 | return $this->checkResources(); |
| 88 | 88 | }; |
| 89 | 89 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function string() |
| 134 | 134 | { |
| 135 | - return collect($this->health())->reduce(function ($current, $resource) { |
|
| 135 | + return collect($this->health())->reduce(function($current, $resource) { |
|
| 136 | 136 | return |
| 137 | 137 | $current. |
| 138 | 138 | ($current ? config('health.string.glue') : ''). |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | /** |
| 153 | 153 | * Get current action. |
| 154 | 154 | * |
| 155 | - * @return mixed |
|
| 155 | + * @return string |
|
| 156 | 156 | */ |
| 157 | 157 | public function getCurrentAction() |
| 158 | 158 | { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | * Get one resource. |
| 299 | 299 | * |
| 300 | 300 | * @param resource|Collection $resource |
| 301 | - * @return resource |
|
| 301 | + * @return Resource |
|
| 302 | 302 | * @throws Exception |
| 303 | 303 | */ |
| 304 | 304 | public function makeResource($resource) |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | /** |
| 314 | 314 | * Sort resources. |
| 315 | 315 | * |
| 316 | - * @param $resources |
|
| 316 | + * @param Collection $resources |
|
| 317 | 317 | * @return \Illuminate\Support\Collection |
| 318 | 318 | */ |
| 319 | 319 | protected function sortResources($resources) |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function checkResources($force = false) |
| 81 | 81 | { |
| 82 | - if (! ($resources = $this->getCachedResources($force))->isEmpty()) { |
|
| 82 | + if (!($resources = $this->getCachedResources($force))->isEmpty()) { |
|
| 83 | 83 | return $resources; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if (! $this->allResourcesAreGood()) { |
|
| 86 | + if (!$this->allResourcesAreGood()) { |
|
| 87 | 87 | return $this->resources = collect(); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $resources = $this->sortResources( |
| 91 | 91 | $this->getNonGlobalResources() |
| 92 | - ->each(function ($resource) { |
|
| 92 | + ->each(function($resource) { |
|
| 93 | 93 | $this->checkResource($resource); |
| 94 | 94 | }) |
| 95 | 95 | ->merge( |
| 96 | - $this->getGlobalResources()->each(function ($resource) { |
|
| 96 | + $this->getGlobalResources()->each(function($resource) { |
|
| 97 | 97 | return $resource->checkGlobal($this->getResources()); |
| 98 | 98 | }) |
| 99 | 99 | ) |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | ? $resource |
| 119 | 119 | : $this->getResourceBySlug($resource); |
| 120 | 120 | |
| 121 | - $checked = $this->cache->remember($resource->slug, function () use ( |
|
| 121 | + $checked = $this->cache->remember($resource->slug, function() use ( |
|
| 122 | 122 | $resource |
| 123 | 123 | ) { |
| 124 | 124 | return $resource->check($this->getCurrentAction()); |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | protected function allResourcesAreGood() |
| 169 | 169 | { |
| 170 | - return ! $this->getResources() |
|
| 171 | - ->reject(function ($resource) { |
|
| 172 | - return ! $resource instanceof Resource; |
|
| 170 | + return !$this->getResources() |
|
| 171 | + ->reject(function($resource) { |
|
| 172 | + return !$resource instanceof Resource; |
|
| 173 | 173 | }) |
| 174 | 174 | ->isEmpty(); |
| 175 | 175 | } |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | protected function getNonGlobalResources() |
| 184 | 184 | { |
| 185 | - return $this->getResources()->filter(function (Resource $resource) { |
|
| 186 | - return ! $resource->isGlobal; |
|
| 185 | + return $this->getResources()->filter(function(Resource $resource) { |
|
| 186 | + return !$resource->isGlobal; |
|
| 187 | 187 | }); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | protected function getGlobalResources() |
| 197 | 197 | { |
| 198 | - return $this->getResources()->filter(function (Resource $resource) { |
|
| 198 | + return $this->getResources()->filter(function(Resource $resource) { |
|
| 199 | 199 | return $resource->isGlobal; |
| 200 | 200 | }); |
| 201 | 201 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ? $exception->getMessage() |
| 228 | 228 | : static::UNKNOWN_ERROR; |
| 229 | 229 | |
| 230 | - if (! isset($resourceChecker)) { |
|
| 230 | + if (!isset($resourceChecker)) { |
|
| 231 | 231 | return [ |
| 232 | 232 | null, |
| 233 | 233 | [ |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | if (is_null($this->resources) || $this->resources->isEmpty()) { |
| 285 | 285 | $this->resources = $this->resourceLoader->loadResources()->map( |
| 286 | - function ($resource) { |
|
| 287 | - return $this->handleExceptions(function () use ($resource) { |
|
| 286 | + function($resource) { |
|
| 287 | + return $this->handleExceptions(function() use ($resource) { |
|
| 288 | 288 | return $this->makeResource($resource); |
| 289 | 289 | }); |
| 290 | 290 | } |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | protected function sortResources($resources) |
| 320 | 320 | { |
| 321 | 321 | if ($sortBy = config('health.sort_by')) { |
| 322 | - return $resources->sortBy(function ($resource) use ($sortBy) { |
|
| 323 | - return $this->handleExceptions(function () use ( |
|
| 322 | + return $resources->sortBy(function($resource) use ($sortBy) { |
|
| 323 | + return $this->handleExceptions(function() use ( |
|
| 324 | 324 | $resource, |
| 325 | 325 | $sortBy |
| 326 | 326 | ) { |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | config('health.notifications.from.icon_emoji') |
| 104 | 104 | ) |
| 105 | 105 | ->content($this->getMessage()) |
| 106 | - ->attachment(function ($attachment) { |
|
| 106 | + ->attachment(function($attachment) { |
|
| 107 | 107 | $attachment |
| 108 | 108 | ->title($this->getActionTitle(), $this->getActionLink()) |
| 109 | 109 | ->content($this->result->errorMessage); |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | /** |
| 133 | 133 | * Get the action message. |
| 134 | 134 | * |
| 135 | - * @param $item |
|
| 136 | - * @return \Illuminate\Config\Repository|mixed |
|
| 135 | + * @param HealthStatus $item |
|
| 136 | + * @return string |
|
| 137 | 137 | */ |
| 138 | 138 | private function getActionMessage($item) |
| 139 | 139 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * Get the action title. |
| 147 | 147 | * |
| 148 | - * @return mixed |
|
| 148 | + * @return string |
|
| 149 | 149 | */ |
| 150 | 150 | protected function getActionTitle() |
| 151 | 151 | { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | /** |
| 156 | 156 | * Get the email subject. |
| 157 | 157 | * |
| 158 | - * @return mixed |
|
| 158 | + * @return string |
|
| 159 | 159 | */ |
| 160 | 160 | protected function getSubject() |
| 161 | 161 | { |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | protected function horizonIsRunning() |
| 27 | 27 | { |
| 28 | - if (! $masters = app(MasterSupervisorRepository::class)->all()) { |
|
| 28 | + if (!$masters = app(MasterSupervisorRepository::class)->all()) { |
|
| 29 | 29 | return false; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - return collect($masters)->contains(function ($master) { |
|
| 32 | + return collect($masters)->contains(function($master) { |
|
| 33 | 33 | return $master->status === 'paused'; |
| 34 | 34 | }) |
| 35 | 35 | ? false |