original_string: public function generate()
      {
          $pickChars = str_repeat(static::DICTIONARY, static::LENGTH);
          for (; ;) {
              $value = substr(str_shuffle($pickChars), 0, static::LENGTH);
              if (preg_match(static::TOKEN_GENERATION_REGEX, $value)) {
                  $this->insertQuery->execute([$value]);
                  if ($this->insertQuery->rowCount() === 1) {
                      break;
                  }
              }
          }
  
          return $value;
      }
code: public function generate()
      {
          $pickChars = str_repeat(static::DICTIONARY, static::LENGTH);
          for (; ;) {
              $value = substr(str_shuffle($pickChars), 0, static::LENGTH);
              if (preg_match(static::TOKEN_GENERATION_REGEX, $value)) {
                  $this->insertQuery->execute([$value]);
                  if ($this->insertQuery->rowCount() === 1) {
                      break;
                  }
              }
          }
  
          return $value;
      }
code_tokens: public function generate ( ) { $ pickChars = str_repeat ( static :: DICTIONARY , static :: LENGTH ) ; for ( ; ; ) { $ value = substr ( str_shuffle ( $ pickChars ) , 0 , static :: LENGTH ) ; if ( preg_match ( static :: TOKEN_GENERATION_REGEX , $ value ) ) { $ this -> insertQuery -> execute ( [ $ value ] ) ; if ( $ this -> insertQuery -> rowCount ( ) === 1 ) { break ; } } } return $ value ; }
docstring: Generate a new API token.
  
  @return string
docstring_tokens: Generate a new API token .