diff --git a/README.md b/README.md index eba6663..6b213b2 100644 --- a/README.md +++ b/README.md @@ -332,9 +332,9 @@ public function status() { try { Redis::ping(); - } catch (Exception $e) { + } catch (Exception $exception) { return $this->problem('Failed to connect to redis', [ - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } diff --git a/src/Checks/CacheHealthCheck.php b/src/Checks/CacheHealthCheck.php index b27cc1a..8b48596 100644 --- a/src/Checks/CacheHealthCheck.php +++ b/src/Checks/CacheHealthCheck.php @@ -47,10 +47,10 @@ public function status(): Status } $this->workingStores[] = $store; - } catch (Exception $e) { + } catch (Exception $exception) { $this->exceptions[] = [ 'store' => $store, - 'error' => $e->getMessage() + 'error' => $exception->getMessage() ]; } } diff --git a/src/Checks/CrossServiceHealthCheck.php b/src/Checks/CrossServiceHealthCheck.php index 20930a0..28f4ca6 100644 --- a/src/Checks/CrossServiceHealthCheck.php +++ b/src/Checks/CrossServiceHealthCheck.php @@ -35,10 +35,10 @@ public function status(): Status $this->http->get($service, [ 'headers' => ['X-Service-Check' => true], ]); - } catch (GuzzleException $e) { + } catch (GuzzleException $exception) { $failedServices[] = [ 'service' => $service, - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]; } } diff --git a/src/Checks/DatabaseHealthCheck.php b/src/Checks/DatabaseHealthCheck.php index a6487b3..3412c10 100644 --- a/src/Checks/DatabaseHealthCheck.php +++ b/src/Checks/DatabaseHealthCheck.php @@ -25,10 +25,10 @@ public function status(): Status } $this->database->connection($connection)->getPdo(); - } catch (Exception $e) { + } catch (Exception $exception) { return $this->problem('Could not connect to db', [ 'connection' => $connection, - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } } diff --git a/src/Checks/LogHealthCheck.php b/src/Checks/LogHealthCheck.php index 3ab029a..1237c32 100644 --- a/src/Checks/LogHealthCheck.php +++ b/src/Checks/LogHealthCheck.php @@ -27,9 +27,9 @@ public function status(): Status { try { $this->logger->info('Checking if logs are writable'); - } catch (Exception $e) { + } catch (Exception $exception) { return $this->problem('Could not write to log file', [ - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } diff --git a/src/Checks/MigrationUpToDateHealthCheck.php b/src/Checks/MigrationUpToDateHealthCheck.php index 833a84e..aeffac3 100644 --- a/src/Checks/MigrationUpToDateHealthCheck.php +++ b/src/Checks/MigrationUpToDateHealthCheck.php @@ -2,6 +2,7 @@ namespace UKFast\HealthCheck\Checks; +use Exception; use Illuminate\Database\Migrations\Migrator; use UKFast\HealthCheck\HealthCheck; use UKFast\HealthCheck\Status; @@ -23,9 +24,9 @@ public function status(): Status ['pending_migrations' => $pendingMigrations] ); } - } catch (\Exception $e) { + } catch (Exception $exception) { return $this->problem('Exceptions during migrations check', [ - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } diff --git a/src/Checks/PackageSecurityHealthCheck.php b/src/Checks/PackageSecurityHealthCheck.php index 5c12a04..14f6934 100644 --- a/src/Checks/PackageSecurityHealthCheck.php +++ b/src/Checks/PackageSecurityHealthCheck.php @@ -74,9 +74,9 @@ public function status(): Status ); } } - } catch (Exception $e) { + } catch (Exception $exception) { return $this->problem('Failed to check packages for security vulnerabilities', [ - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } diff --git a/src/Checks/RedisHealthCheck.php b/src/Checks/RedisHealthCheck.php index 934a8ef..f171915 100644 --- a/src/Checks/RedisHealthCheck.php +++ b/src/Checks/RedisHealthCheck.php @@ -17,9 +17,9 @@ public function status(): Status { try { $this->handlePing(); - } catch (Exception $e) { + } catch (Exception $exception) { return $this->problem('Failed to connect to redis', [ - 'exception' => $this->exceptionContext($e), + 'exception' => $this->exceptionContext($exception), ]); } return $this->okay(); diff --git a/src/Checks/StorageHealthCheck.php b/src/Checks/StorageHealthCheck.php index 05cc419..f18e788 100644 --- a/src/Checks/StorageHealthCheck.php +++ b/src/Checks/StorageHealthCheck.php @@ -50,10 +50,10 @@ public function status(): Status } $this->workingDisks[] = $disk; - } catch (Exception $e) { + } catch (Exception $exception) { $this->exceptions[] = [ 'disk' => $disk, - 'error' => $this->exceptionContext($e), + 'error' => $this->exceptionContext($exception), ]; } }