original_string: public function actionConfirmPasswordHistory($user, $password)
      {
          $user = $this->getUser($user);
          $passwordHistory = $user->passwordHistories;
          $passwordInHistory = 0;
          foreach ($passwordHistory as $pass) {
              if ($pass->validatePassword($password)) {
                  $passwordInHistory++;
                  echo "This password was created at " . $pass->getCreatedAt() . ".\n";
              }
          }
          if ($passwordInHistory) {
              echo "$passwordInHistory matched.\n";
              return static::EXIT_CODE_NORMAL;
          }
          echo "No password matched.\n";
          return static::EXIT_CODE_ERROR;
      }
code: public function actionConfirmPasswordHistory($user, $password)
      {
          $user = $this->getUser($user);
          $passwordHistory = $user->passwordHistories;
          $passwordInHistory = 0;
          foreach ($passwordHistory as $pass) {
              if ($pass->validatePassword($password)) {
                  $passwordInHistory++;
                  echo "This password was created at " . $pass->getCreatedAt() . ".\n";
              }
          }
          if ($passwordInHistory) {
              echo "$passwordInHistory matched.\n";
              return static::EXIT_CODE_NORMAL;
          }
          echo "No password matched.\n";
          return static::EXIT_CODE_ERROR;
      }
code_tokens: public function actionConfirmPasswordHistory ( $ user , $ password ) { $ user = $ this -> getUser ( $ user ) ; $ passwordHistory = $ user -> passwordHistories ; $ passwordInHistory = 0 ; foreach ( $ passwordHistory as $ pass ) { if ( $ pass -> validatePassword ( $ password ) ) { $ passwordInHistory ++ ; echo "This password was created at " . $ pass -> getCreatedAt ( ) . ".\n" ; } } if ( $ passwordInHistory ) { echo "$passwordInHistory matched.\n" ; return static :: EXIT_CODE_NORMAL ; } echo "No password matched.\n" ; return static :: EXIT_CODE_ERROR ; }
docstring: Confirm password in history.
  This command will list all matching passwords in reverse order.
  @param User|string|integer $user User ID.
  @param string $password Password.
  @return int
docstring_tokens: Confirm password in history . This command will list all matching passwords in reverse order .