original_string: public function resetPassword(User $user, string $newPassword)
      {
          $this->enforcePasswordStrength($newPassword);
  
          $auth = $this->authenticationProvider->findByUserId($user->getId());
          if (!$auth) {
              throw new NoSuchUserException();
          }
  
          $hash = password_hash($newPassword, PASSWORD_DEFAULT);
          $auth->setHash($hash);
          $this->resetAuthenticationKey($auth);
          $this->authenticationProvider->update($auth);
      }
code: public function resetPassword(User $user, string $newPassword)
      {
          $this->enforcePasswordStrength($newPassword);
  
          $auth = $this->authenticationProvider->findByUserId($user->getId());
          if (!$auth) {
              throw new NoSuchUserException();
          }
  
          $hash = password_hash($newPassword, PASSWORD_DEFAULT);
          $auth->setHash($hash);
          $this->resetAuthenticationKey($auth);
          $this->authenticationProvider->update($auth);
      }
code_tokens: public function resetPassword ( User $ user , string $ newPassword ) { $ this -> enforcePasswordStrength ( $ newPassword ) ; $ auth = $ this -> authenticationProvider -> findByUserId ( $ user -> getId ( ) ) ; if ( ! $ auth ) { throw new NoSuchUserException ( ) ; } $ hash = password_hash ( $ newPassword , PASSWORD_DEFAULT ) ; $ auth -> setHash ( $ hash ) ; $ this -> resetAuthenticationKey ( $ auth ) ; $ this -> authenticationProvider -> update ( $ auth ) ; }
docstring: Reset this user's password
  
  @param User   $user        The user to whom this password gets assigned
  @param string $newPassword Cleartext password that's being hashed
  
  @throws NoSuchUserException
  @throws WeakPasswordException
docstring_tokens: Reset this user s password