diff --git a/app/Exceptions/CannotCreateUser.php b/app/Exceptions/CannotCreateUser.php index cb2acbe37..c97f5486a 100644 --- a/app/Exceptions/CannotCreateUser.php +++ b/app/Exceptions/CannotCreateUser.php @@ -6,12 +6,12 @@ class CannotCreateUser extends Exception { - public static function duplicateEmailAddress(string $emailAddress): CannotCreateUser + public static function duplicateEmailAddress(string $emailAddress): self { return new static("The email address [$emailAddress] already exists."); } - public static function duplicateUsername(string $username): CannotCreateUser + public static function duplicateUsername(string $username): self { return new static("The username [$username] already exists."); } diff --git a/app/User.php b/app/User.php index f2999939b..0dbf4faf2 100644 --- a/app/User.php +++ b/app/User.php @@ -216,17 +216,17 @@ public function countSolutions(): int })->count(); } - public static function findByUsername(string $username): User + public static function findByUsername(string $username): self { return static::where('username', $username)->firstOrFail(); } - public static function findByEmailAddress(string $emailAddress): User + public static function findByEmailAddress(string $emailAddress): self { return static::where('email', $emailAddress)->firstOrFail(); } - public static function findByGithubId(string $githubId): User + public static function findByGithubId(string $githubId): self { return static::where('github_id', $githubId)->firstOrFail(); }