From d59ac83d13f82d42086078647a843e8654e8fe06 Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 26 Feb 2017 13:13:37 +0100 Subject: [PATCH] Refactor array definition in 'authenticateUserInternal' --- src/Auth.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Auth.php b/src/Auth.php index 1f2c53b..013009e 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -613,6 +613,8 @@ final class Auth extends UserManager { * @throws AuthError if an internal problem occurred (do *not* catch) */ private function authenticateUserInternal($password, $email = null, $username = null, $rememberDuration = null) { + $columnsToFetch = [ 'id', 'email', 'password', 'verified', 'username', 'status' ]; + if ($email !== null) { $email = self::validateEmailAddress($email); @@ -620,7 +622,7 @@ final class Auth extends UserManager { try { $userData = $this->getUserDataByEmailAddress( $email, - [ 'id', 'email', 'password', 'verified', 'username', 'status' ] + $columnsToFetch ); } // if there is no user with the specified email address @@ -640,7 +642,7 @@ final class Auth extends UserManager { try { $userData = $this->getUserDataByUsername( $username, - [ 'id', 'email', 'password', 'verified', 'username', 'status' ] + $columnsToFetch ); } // if there is no user with the specified username