From 935efcc71cdb37fde4da68e2c70b8815f4f2c9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=A4drich?= <11225821+shaedrich@users.noreply.github.com> Date: Wed, 18 Dec 2024 23:38:40 +0100 Subject: [PATCH] Change casing for enum cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Džuris --- src/Illuminate/Auth/Enums/PasswordStatus.php | 10 +++++----- src/Illuminate/Auth/Passwords/PasswordBroker.php | 14 +++++++------- src/Illuminate/Contracts/Auth/PasswordBroker.php | 10 +++++----- src/Illuminate/Support/Facades/Password.php | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Illuminate/Auth/Enums/PasswordStatus.php b/src/Illuminate/Auth/Enums/PasswordStatus.php index 3efb8da4b17..bb76407f8fa 100644 --- a/src/Illuminate/Auth/Enums/PasswordStatus.php +++ b/src/Illuminate/Auth/Enums/PasswordStatus.php @@ -7,25 +7,25 @@ enum PasswordStatus: string /** * Constant representing a successfully sent reminder. */ - case RESET_LINK_SENT = 'passwords.sent'; + case ResetLinkSent = 'passwords.sent'; /** * Constant representing a successfully reset password. */ - case PASSWORD_RESET = 'passwords.reset'; + case PasswordReset = 'passwords.reset'; /** * Constant representing the user not found response. */ - case INVALID_USER = 'passwords.user'; + case InvalidUser = 'passwords.user'; /** * Constant representing an invalid token. */ - case INVALID_TOKEN = 'passwords.token'; + case InvalidToken = 'passwords.token'; /** * Constant representing a throttled reset attempt. */ - case RESET_THROTTLED = 'passwords.throttled'; + case ResetThrottled = 'passwords.throttled'; } diff --git a/src/Illuminate/Auth/Passwords/PasswordBroker.php b/src/Illuminate/Auth/Passwords/PasswordBroker.php index 5b9ea849d93..5e7af490cd2 100755 --- a/src/Illuminate/Auth/Passwords/PasswordBroker.php +++ b/src/Illuminate/Auth/Passwords/PasswordBroker.php @@ -65,17 +65,17 @@ public function sendResetLink(#[\SensitiveParameter] array $credentials, ?Closur $user = $this->getUser($credentials); if (is_null($user)) { - return PasswordStatus::INVALID_USER; + return PasswordStatus::InvalidUser; } if ($this->tokens->recentlyCreatedToken($user)) { - return PasswordStatus::RESET_THROTTLED; + return PasswordStatus::ResetThrottled; } $token = $this->tokens->create($user); if ($callback) { - return $callback($user, $token) ?? PasswordStatus::RESET_LINK_SENT; + return $callback($user, $token) ?? PasswordStatus::ResetLinkSent; } // Once we have the reset token, we are ready to send the message out to this @@ -85,7 +85,7 @@ public function sendResetLink(#[\SensitiveParameter] array $credentials, ?Closur $this->events?->dispatch(new PasswordResetLinkSent($user)); - return PasswordStatus::RESET_LINK_SENT; + return PasswordStatus::ResetLinkSent; } /** @@ -115,7 +115,7 @@ public function reset(#[\SensitiveParameter] array $credentials, Closure $callba $this->tokens->delete($user); - return PasswordStatus::PASSWORD_RESET; + return PasswordStatus::PasswordReset; } /** @@ -127,11 +127,11 @@ public function reset(#[\SensitiveParameter] array $credentials, Closure $callba protected function validateReset(#[\SensitiveParameter] array $credentials) { if (is_null($user = $this->getUser($credentials))) { - return PasswordStatus::INVALID_USER; + return PasswordStatus::InvalidUser; } if (! $this->tokens->exists($user, $credentials['token'])) { - return PasswordStatus::INVALID_TOKEN; + return PasswordStatus::InvalidToken; } return $user; diff --git a/src/Illuminate/Contracts/Auth/PasswordBroker.php b/src/Illuminate/Contracts/Auth/PasswordBroker.php index 6b9e86c722c..1c9d76cca41 100644 --- a/src/Illuminate/Contracts/Auth/PasswordBroker.php +++ b/src/Illuminate/Contracts/Auth/PasswordBroker.php @@ -12,35 +12,35 @@ interface PasswordBroker * * @var string */ - const RESET_LINK_SENT = PasswordStatus::RESET_LINK_SENT; + const RESET_LINK_SENT = PasswordStatus::ResetLinkSent; /** * Constant representing a successfully reset password. * * @var string */ - const PASSWORD_RESET = PasswordStatus::PASSWORD_RESET; + const PASSWORD_RESET = PasswordStatus::PasswordReset; /** * Constant representing the user not found response. * * @var string */ - const INVALID_USER = PasswordStatus::INVALID_USER; + const INVALID_USER = PasswordStatus::InvalidUser; /** * Constant representing an invalid token. * * @var string */ - const INVALID_TOKEN = PasswordStatus::INVALID_TOKEN; + const INVALID_TOKEN = PasswordStatus::InvalidToken; /** * Constant representing a throttled reset attempt. * * @var string */ - const RESET_THROTTLED = PasswordStatus::RESET_THROTTLED; + const RESET_THROTTLED = PasswordStatus::ResetThrottled; /** * Send a password reset link to a user. diff --git a/src/Illuminate/Support/Facades/Password.php b/src/Illuminate/Support/Facades/Password.php index 8b723780389..3ea4081a576 100755 --- a/src/Illuminate/Support/Facades/Password.php +++ b/src/Illuminate/Support/Facades/Password.php @@ -26,35 +26,35 @@ class Password extends Facade * * @var string */ - const RESET_LINK_SENT = PasswordStatus::RESET_LINK_SENT; + const RESET_LINK_SENT = PasswordStatus::ResetLinkSent; /** * Constant representing a successfully reset password. * * @var string */ - const PASSWORD_RESET = PasswordStatus::PASSWORD_RESET; + const PASSWORD_RESET = PasswordStatus::PasswordReset; /** * Constant representing the user not found response. * * @var string */ - const INVALID_USER = PasswordStatus::INVALID_USER; + const INVALID_USER = PasswordStatus::InvalidUser; /** * Constant representing an invalid token. * * @var string */ - const INVALID_TOKEN = PasswordStatus::INVALID_TOKEN; + const INVALID_TOKEN = PasswordStatus::InvalidToken; /** * Constant representing a throttled reset attempt. * * @var string */ - const RESET_THROTTLED = PasswordStatus::RESET_THROTTLED; + const RESET_THROTTLED = PasswordStatus::ResetThrottled; /** * Get the registered name of the component.