original_string: public function getDsn()
      {
          if ($this->dsn) {
              return $this->dsn;
          }
  
          $dsn = $this->driver . ':';
          switch ($this->driver) {
              case 'mysql':
                  $this->host && $dsn .= 'host=' . $this->host . ';';
                  $this->port && $dsn .= 'port=' . $this->port . ';';
                  $this->dbname && $dsn .= 'dbname=' . $this->dbname . ';';
                  $this->unixSocket && $dsn .= 'unix_socket=' . $this->unixSocket . ';';
                  $this->charset && $dsn .= 'charset=' . $this->charset;
                  break;
  
              case 'sqlite':
                  $dsn .= $this->path;
                  break;
  
              case 'pgsql':
                  $this->host && $dsn .= 'host=' . $this->host . ';';
                  $this->port && $dsn .= 'port=' . $this->port . ';';
                  $this->dbname && $dsn .= 'dbname=' . $this->dbname;
                  break;
  
              default:
                  throw new \RuntimeException(sprintf('Unsupported database driver: %s', $this->driver));
          }
          return $this->dsn = $dsn;
      }
code: public function getDsn()
      {
          if ($this->dsn) {
              return $this->dsn;
          }
  
          $dsn = $this->driver . ':';
          switch ($this->driver) {
              case 'mysql':
                  $this->host && $dsn .= 'host=' . $this->host . ';';
                  $this->port && $dsn .= 'port=' . $this->port . ';';
                  $this->dbname && $dsn .= 'dbname=' . $this->dbname . ';';
                  $this->unixSocket && $dsn .= 'unix_socket=' . $this->unixSocket . ';';
                  $this->charset && $dsn .= 'charset=' . $this->charset;
                  break;
  
              case 'sqlite':
                  $dsn .= $this->path;
                  break;
  
              case 'pgsql':
                  $this->host && $dsn .= 'host=' . $this->host . ';';
                  $this->port && $dsn .= 'port=' . $this->port . ';';
                  $this->dbname && $dsn .= 'dbname=' . $this->dbname;
                  break;
  
              default:
                  throw new \RuntimeException(sprintf('Unsupported database driver: %s', $this->driver));
          }
          return $this->dsn = $dsn;
      }
code_tokens: public function getDsn ( ) { if ( $ this -> dsn ) { return $ this -> dsn ; } $ dsn = $ this -> driver . ':' ; switch ( $ this -> driver ) { case 'mysql' : $ this -> host && $ dsn .= 'host=' . $ this -> host . ';' ; $ this -> port && $ dsn .= 'port=' . $ this -> port . ';' ; $ this -> dbname && $ dsn .= 'dbname=' . $ this -> dbname . ';' ; $ this -> unixSocket && $ dsn .= 'unix_socket=' . $ this -> unixSocket . ';' ; $ this -> charset && $ dsn .= 'charset=' . $ this -> charset ; break ; case 'sqlite' : $ dsn .= $ this -> path ; break ; case 'pgsql' : $ this -> host && $ dsn .= 'host=' . $ this -> host . ';' ; $ this -> port && $ dsn .= 'port=' . $ this -> port . ';' ; $ this -> dbname && $ dsn .= 'dbname=' . $ this -> dbname ; break ; default : throw new \ RuntimeException ( sprintf ( 'Unsupported database driver: %s' , $ this -> driver ) ) ; } return $ this -> dsn = $ dsn ; }
docstring: Returns the PDO DSN
  
  @return string
  @throws \RuntimeException When database driver is unsupported
docstring_tokens: Returns the PDO DSN