code: public function getDsn(array $info) : string
      {
          $dsn = 'pgsql:host=';
          $dsn .= (isset($info['host']) === true ? $info['host'] : 'localhost') . ';';
          if (isset($info['port']) === true) {
              $dsn .= 'port=' . $info['port'] . ';';
          }
          $dsn .= 'dbname=' . $info['name'] . ';';
  
          return $dsn;
      }
docs: Get DSN string for PDO according to specified info.
  
  @param  array  $info database info
  @return string DSN string