original_string: public function resetPassword(array $data)
      {
          $result = array();
          $this->hook->attach('user.reset.password.before', $data, $result, $this);
  
          if (!empty($result)) {
              return (array) $result;
          }
  
          if (empty($data['user']['user_id'])) {
              return $this->getResultError();
          }
  
          if (isset($data['password'])) {
              $result = $this->resetPasswordFinish($data);
          } else {
              $result = $this->resetPasswordStart($data);
          }
  
          $this->session->regenerate(true);
          $this->hook->attach('user.reset.password.after', $data, $result, $this);
          return (array) $result;
      }
code: public function resetPassword(array $data)
      {
          $result = array();
          $this->hook->attach('user.reset.password.before', $data, $result, $this);
  
          if (!empty($result)) {
              return (array) $result;
          }
  
          if (empty($data['user']['user_id'])) {
              return $this->getResultError();
          }
  
          if (isset($data['password'])) {
              $result = $this->resetPasswordFinish($data);
          } else {
              $result = $this->resetPasswordStart($data);
          }
  
          $this->session->regenerate(true);
          $this->hook->attach('user.reset.password.after', $data, $result, $this);
          return (array) $result;
      }
code_tokens: public function resetPassword ( array $ data ) { $ result = array ( ) ; $ this -> hook -> attach ( 'user.reset.password.before' , $ data , $ result , $ this ) ; if ( ! empty ( $ result ) ) { return ( array ) $ result ; } if ( empty ( $ data [ 'user' ] [ 'user_id' ] ) ) { return $ this -> getResultError ( ) ; } if ( isset ( $ data [ 'password' ] ) ) { $ result = $ this -> resetPasswordFinish ( $ data ) ; } else { $ result = $ this -> resetPasswordStart ( $ data ) ; } $ this -> session -> regenerate ( true ) ; $ this -> hook -> attach ( 'user.reset.password.after' , $ data , $ result , $ this ) ; return ( array ) $ result ; }
docstring: Performs reset password operation
  @param array $data
  @return array
docstring_tokens: Performs reset password operation