public static function signUp(UserId $anId, UserEmail $anEmail, UserPassword $aPassword, array $userRoles)
    {
        $user = new static($anId, $anEmail, $userRoles, $aPassword);
        $user->confirmationToken = new UserToken();
        $user->publish(
            new UserRegistered(
                $user->id(),
                $user->email(),
                $user->confirmationToken()
            )
        );

        return $user;
    }
public static function signUp(UserId $anId, UserEmail $anEmail, UserPassword $aPassword, array $userRoles)
    {
        $user = new static($anId, $anEmail, $userRoles, $aPassword);
        $user->confirmationToken = new UserToken();
        $user->publish(
            new UserRegistered(
                $user->id(),
                $user->email(),
                $user->confirmationToken()
            )
        );

        return $user;
    }
public static function signUp ( UserId $ anId , UserEmail $ anEmail , UserPassword $ aPassword , array $ userRoles ) { $ user = new static ( $ anId , $ anEmail , $ userRoles , $ aPassword ) ; $ user -> confirmationToken = new UserToken ( ) ; $ user -> publish ( new UserRegistered ( $ user -> id ( ) , $ user -> email ( ) , $ user -> confirmationToken ( ) ) ) ; return $ user ; }
Sign up user.

@param UserId       $anId      The id
@param UserEmail    $anEmail   The email
@param UserPassword $aPassword The encoded password
@param array        $userRoles Array which contains the roles

@return static
Sign up user .