original_string: public function register()
      {
          if (!$this->validate()) {
              return false;
          }
  
          /** @var User $user */
          $user = Yii::createObject(ModelMapHelper::User());
  
          $user->setAttributes($this->attributes);
  
          $result = $user->register();
          if ($user->hasErrors()) {
              foreach ($user->errors as $attribute => $errors) {
                  foreach ($errors as $error) {
                      $this->addError($attribute, $error);
                  }
              }
          }
  
          return $result;
      }
code: public function register()
      {
          if (!$this->validate()) {
              return false;
          }
  
          /** @var User $user */
          $user = Yii::createObject(ModelMapHelper::User());
  
          $user->setAttributes($this->attributes);
  
          $result = $user->register();
          if ($user->hasErrors()) {
              foreach ($user->errors as $attribute => $errors) {
                  foreach ($errors as $error) {
                      $this->addError($attribute, $error);
                  }
              }
          }
  
          return $result;
      }
code_tokens: public function register ( ) { if ( ! $ this -> validate ( ) ) { return false ; } /** @var User $user */ $ user = Yii :: createObject ( ModelMapHelper :: User ( ) ) ; $ user -> setAttributes ( $ this -> attributes ) ; $ result = $ user -> register ( ) ; if ( $ user -> hasErrors ( ) ) { foreach ( $ user -> errors as $ attribute => $ errors ) { foreach ( $ errors as $ error ) { $ this -> addError ( $ attribute , $ error ) ; } } } return $ result ; }
docstring: Performs registration of user.
  Returns User object on success or false on failure.
  
  @return bool|User
  @throws \yii\base\InvalidConfigException
docstring_tokens: Performs registration of user . Returns User object on success or false on failure .