1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-11 19:46:22 +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)
*/
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