protected function registerUser($email, $facebookUserId)
    {
        $className = $this->userService->getUserClass();
        /** @var BaseUser $user */
        $user = (new  $className());
        $user->setEmail($email)
            ->setFacebookUserId($facebookUserId)
            ->setPlainPassword(base64_encode(random_bytes(20)));
        $this->userService->registerUser($user, UserService::SOURCE_TYPE_FACEBOOK);

        return $user;
    }
protected function registerUser($email, $facebookUserId)
    {
        $className = $this->userService->getUserClass();
        /** @var BaseUser $user */
        $user = (new  $className());
        $user->setEmail($email)
            ->setFacebookUserId($facebookUserId)
            ->setPlainPassword(base64_encode(random_bytes(20)));
        $this->userService->registerUser($user, UserService::SOURCE_TYPE_FACEBOOK);

        return $user;
    }
protected function registerUser ( $ email , $ facebookUserId ) { $ className = $ this -> userService -> getUserClass ( ) ; /** @var BaseUser $user */ $ user = ( new $ className ( ) ) ; $ user -> setEmail ( $ email ) -> setFacebookUserId ( $ facebookUserId ) -> setPlainPassword ( base64_encode ( random_bytes ( 20 ) ) ) ; $ this -> userService -> registerUser ( $ user , UserService :: SOURCE_TYPE_FACEBOOK ) ; return $ user ; }
We register the user with their facebook id and email.

@param string $email
@param string $facebookUserId
@return BaseUser
We register the user with their facebook id and email .