original_string: public function connect()
      {
          $dsnString = "{$this->dbDriver}:host={$this->dbHostname};dbname={$this->dbName};";
          $dsnString .= "charset={$this->dbCharset}";
          /*
           * Try to connect to database
           */
          try {
              $this->dbConnection = new \PDO(
                  $dsnString,
                  "{$this->dbUsername}",
                  "{$this->dbPassword}",
                  $this->driverOptions
              );
          } catch (\PDOException $ex) {
              // Error during database connection, check params.
              throw new \InvalidArgumentException(
                  __METHOD__.': '.$ex->getMessage()
              );
          }
  
          return $this->dbConnection;
      }
code: public function connect()
      {
          $dsnString = "{$this->dbDriver}:host={$this->dbHostname};dbname={$this->dbName};";
          $dsnString .= "charset={$this->dbCharset}";
          /*
           * Try to connect to database
           */
          try {
              $this->dbConnection = new \PDO(
                  $dsnString,
                  "{$this->dbUsername}",
                  "{$this->dbPassword}",
                  $this->driverOptions
              );
          } catch (\PDOException $ex) {
              // Error during database connection, check params.
              throw new \InvalidArgumentException(
                  __METHOD__.': '.$ex->getMessage()
              );
          }
  
          return $this->dbConnection;
      }
code_tokens: public function connect ( ) { $ dsnString = "{$this->dbDriver}:host={$this->dbHostname};dbname={$this->dbName};" ; $ dsnString .= "charset={$this->dbCharset}" ; /*
           * Try to connect to database
           */ try { $ this -> dbConnection = new \ PDO ( $ dsnString , "{$this->dbUsername}" , "{$this->dbPassword}" , $ this -> driverOptions ) ; } catch ( \ PDOException $ ex ) { // Error during database connection, check params. throw new \ InvalidArgumentException ( __METHOD__ . ': ' . $ ex -> getMessage ( ) ) ; } return $ this -> dbConnection ; }
docstring: Connect to a database by using constructor params
  
  @return PDO
  
  @throws \Exception
docstring_tokens: Connect to a database by using constructor params