From e5597dfc1b2247481da29f3ce8163360b158aa03 Mon Sep 17 00:00:00 2001 From: ju5t Date: Mon, 3 Jun 2024 11:07:13 +0200 Subject: [PATCH] chore: prevent unsafe usage of static --- src/Exceptions/AuthenticationFailed.php | 4 ++-- src/Exceptions/CommandNotFound.php | 4 ++-- src/Exceptions/ConnectionFailed.php | 4 ++-- src/Exceptions/InvalidResponse.php | 4 ++-- src/Exceptions/Unauthorized.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Exceptions/AuthenticationFailed.php b/src/Exceptions/AuthenticationFailed.php index f3e4bfe..b98aca5 100644 --- a/src/Exceptions/AuthenticationFailed.php +++ b/src/Exceptions/AuthenticationFailed.php @@ -6,8 +6,8 @@ class AuthenticationFailed extends HttpException { - public static function create(): static + public static function create(): self { - return new static(401, 'Unauthorized. Please check the credentials.'); + return new self(401, 'Unauthorized. Please check the credentials.'); } } diff --git a/src/Exceptions/CommandNotFound.php b/src/Exceptions/CommandNotFound.php index 55ef487..c0c2850 100644 --- a/src/Exceptions/CommandNotFound.php +++ b/src/Exceptions/CommandNotFound.php @@ -6,8 +6,8 @@ class CommandNotFound extends HttpException { - public static function create(string $command): static + public static function create(string $command): self { - return new static(405, 'Command `'.$command.'` does not exist.'); + return new self(405, 'Command `'.$command.'` does not exist.'); } } diff --git a/src/Exceptions/ConnectionFailed.php b/src/Exceptions/ConnectionFailed.php index 9f4339b..b178b47 100644 --- a/src/Exceptions/ConnectionFailed.php +++ b/src/Exceptions/ConnectionFailed.php @@ -6,8 +6,8 @@ class ConnectionFailed extends HttpException { - public static function create(string $message): static + public static function create(string $message): self { - return new static(500, $message); + return new self(500, $message); } } diff --git a/src/Exceptions/InvalidResponse.php b/src/Exceptions/InvalidResponse.php index 81d5ad8..2d78468 100644 --- a/src/Exceptions/InvalidResponse.php +++ b/src/Exceptions/InvalidResponse.php @@ -6,8 +6,8 @@ class InvalidResponse extends HttpException { - public static function create(string $message): static + public static function create(string $message): self { - return new static(500, $message); + return new self(500, $message); } } diff --git a/src/Exceptions/Unauthorized.php b/src/Exceptions/Unauthorized.php index 7e4a526..f4b7547 100644 --- a/src/Exceptions/Unauthorized.php +++ b/src/Exceptions/Unauthorized.php @@ -6,8 +6,8 @@ class Unauthorized extends HttpException { - public static function create(): static + public static function create(): self { - return new static(403, 'You do not have access to this resource.'); + return new self(403, 'You do not have access to this resource.'); } }