Skip to content

Commit

Permalink
chore: prevent unsafe usage of static
Browse files Browse the repository at this point in the history
  • Loading branch information
ju5t committed Jun 3, 2024
1 parent ee0524c commit e5597df
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/Exceptions/AuthenticationFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
4 changes: 2 additions & 2 deletions src/Exceptions/CommandNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}
4 changes: 2 additions & 2 deletions src/Exceptions/ConnectionFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions src/Exceptions/InvalidResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions src/Exceptions/Unauthorized.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
}

0 comments on commit e5597df

Please sign in to comment.