Skip to content

Commit

Permalink
Fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit committed Mar 26, 2020
1 parent f91e99b commit f4cd488
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Dsn.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static function parseUds(string $dsn) : self
if (false === $parsed) {
self::throwParseError($dsn);
}
if (isset($parsed['host'])) {
if (isset($parsed['host']) || !isset($parsed['path'])) {
self::throwParseError($dsn);
}

Expand Down Expand Up @@ -181,6 +181,9 @@ public function getInt(string $name, ?int $default = null) : ?int
return $value;
}

/**
* @psalm-return never-returns
*/
private static function throwParseError(string $dsn) : void
{
throw new \InvalidArgumentException(\sprintf('Unable to parse DSN "%s"', $dsn));
Expand Down

0 comments on commit f4cd488

Please sign in to comment.