models/UserIdentity.php
public static function findByUsernameOrEmail($emailOrUsername)
	{
		if (filter_var($emailOrUsername, FILTER_VALIDATE_EMAIL)) {
			return UserIdentity::findByEmail($emailOrUsername);
		}

		return UserIdentity::findByUsername($emailOrUsername);
	}
public static function findByUsernameOrEmail($emailOrUsername)
	{
		if (filter_var($emailOrUsername, FILTER_VALIDATE_EMAIL)) {
			return UserIdentity::findByEmail($emailOrUsername);
		}

		return UserIdentity::findByUsername($emailOrUsername);
	}
Finds user by either username or email

@param string $emailOrUsername

@return \abhimanyu\user\models\UserIdentity|null