1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-11 11:36:24 +02:00

Refactor array definition in 'authenticateUserInternal'

This commit is contained in:
Marco
2017-02-26 13:13:37 +01:00
parent 9a0036b8a8
commit d59ac83d13

View File

@ -613,6 +613,8 @@ final class Auth extends UserManager {
* @throws AuthError if an internal problem occurred (do *not* catch) * @throws AuthError if an internal problem occurred (do *not* catch)
*/ */
private function authenticateUserInternal($password, $email = null, $username = null, $rememberDuration = null) { private function authenticateUserInternal($password, $email = null, $username = null, $rememberDuration = null) {
$columnsToFetch = [ 'id', 'email', 'password', 'verified', 'username', 'status' ];
if ($email !== null) { if ($email !== null) {
$email = self::validateEmailAddress($email); $email = self::validateEmailAddress($email);
@ -620,7 +622,7 @@ final class Auth extends UserManager {
try { try {
$userData = $this->getUserDataByEmailAddress( $userData = $this->getUserDataByEmailAddress(
$email, $email,
[ 'id', 'email', 'password', 'verified', 'username', 'status' ] $columnsToFetch
); );
} }
// if there is no user with the specified email address // if there is no user with the specified email address
@ -640,7 +642,7 @@ final class Auth extends UserManager {
try { try {
$userData = $this->getUserDataByUsername( $userData = $this->getUserDataByUsername(
$username, $username,
[ 'id', 'email', 'password', 'verified', 'username', 'status' ] $columnsToFetch
); );
} }
// if there is no user with the specified username // if there is no user with the specified username