Skip to content

Commit

Permalink
Update DSN.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eldadfux authored Nov 2, 2023
1 parent 5e265ae commit 574eeec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DSN/DSN.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ public function __construct(string $dsn)
}

$this->scheme = $parts['scheme'] ?? null;
$this->user = isset($parts['user']) ? \urldecode($parts['user']) : null;
$this->password = isset($parts['pass']) ? \urldecode($parts['pass']) : null;
$this->host = $parts['host'] ?? null;
$this->user = $parts['user'] ?? null;
$this->password = $parts['pass'] ?? null;
$this->host = $parts['host'] ?? '';
$this->port = $parts['port'] ?? null;
$this->path = isset($parts['path']) ? ltrim($parts['path'], '/') : null;
$this->path = $parts['path'] ?? '';
$this->query = $parts['query'] ?? null;
}
Expand Down Expand Up @@ -125,7 +129,7 @@ public function getPort(): ?string
*/
public function getPath(): ?string
{
return ltrim($this->path, '/');
return $this->path;
}

/**
Expand Down

0 comments on commit 574eeec

Please sign in to comment.