original_string: protected function createUser(array $data, UserProviderInterface $userManager)
      {
          $userIdentityfield = $this->container->getParameter('rch_jwt_user.user_identity_field');
  
          $user = $userManager->createUser()
              ->setUsername($data[$userIdentityfield])
              ->setEmail($data[$userIdentityfield])
              ->setEnabled(true)
              ->setPlainPassword($data['password']);
  
          if (isset($data['facebook_id'])) {
              $user->setFacebookId($data['facebook_id']);
          }
  
          try {
              $userManager->updateUser($user);
          } catch (\Exception $e) {
              $message = $e->getMessage() ?: 'An error occured while creating the user.';
  
              throw new UserException(422, $message, $e);
          }
  
          return $user;
      }
code: protected function createUser(array $data, UserProviderInterface $userManager)
      {
          $userIdentityfield = $this->container->getParameter('rch_jwt_user.user_identity_field');
  
          $user = $userManager->createUser()
              ->setUsername($data[$userIdentityfield])
              ->setEmail($data[$userIdentityfield])
              ->setEnabled(true)
              ->setPlainPassword($data['password']);
  
          if (isset($data['facebook_id'])) {
              $user->setFacebookId($data['facebook_id']);
          }
  
          try {
              $userManager->updateUser($user);
          } catch (\Exception $e) {
              $message = $e->getMessage() ?: 'An error occured while creating the user.';
  
              throw new UserException(422, $message, $e);
          }
  
          return $user;
      }
code_tokens: protected function createUser ( array $ data , UserProviderInterface $ userManager ) { $ userIdentityfield = $ this -> container -> getParameter ( 'rch_jwt_user.user_identity_field' ) ; $ user = $ userManager -> createUser ( ) -> setUsername ( $ data [ $ userIdentityfield ] ) -> setEmail ( $ data [ $ userIdentityfield ] ) -> setEnabled ( true ) -> setPlainPassword ( $ data [ 'password' ] ) ; if ( isset ( $ data [ 'facebook_id' ] ) ) { $ user -> setFacebookId ( $ data [ 'facebook_id' ] ) ; } try { $ userManager -> updateUser ( $ user ) ; } catch ( \ Exception $ e ) { $ message = $ e -> getMessage ( ) ? : 'An error occured while creating the user.' ; throw new UserException ( 422 , $ message , $ e ) ; } return $ user ; }
docstring: Creates a new User.
  
  @param array $data
  @param bool  $isOAuth
  
  @return UserInterface $user
docstring_tokens: Creates a new User .