Skip to content

Commit

Permalink
Fix deprecated warning from passing null to ltrim
Browse files Browse the repository at this point in the history
  • Loading branch information
stnguyen90 committed Jul 31, 2023
1 parent a820cd7 commit aad39f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DSN/DSN.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct(string $dsn)
$this->password = isset($parts['pass']) ? \urldecode($parts['pass']) : null;
$this->host = $parts['host'] ?? null;
$this->port = $parts['port'] ?? null;
$this->path = $parts['path'] ?? null;
$this->path = isset($parts['path']) ? ltrim($parts['path'], '/') : null;
$this->query = $parts['query'] ?? null;
}

Expand Down Expand Up @@ -125,7 +125,7 @@ public function getPort(): ?string
*/
public function getPath(): ?string
{
return ltrim($this->path, '/');
return $this->path;
}

/**
Expand Down

0 comments on commit aad39f4

Please sign in to comment.