Skip to content

Commit

Permalink
Fixing URL building from string
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve McDougall committed Oct 12, 2020
1 parent 990affa commit 496765a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ public static function fromString(string $uri): self

$url = self::build()
->addScheme($uri['scheme'] ?? null)
->addHost($uri['host'] ?? null)
->addPath($uri['path'] ?? null)
->addQuery(isset($uri['query']) ? $uri['query'] : null);
->addHost($uri['host'] ?? null);

if (isset($uri['path'])) {
$url->addPath($uri['path'] ?? null);
}

if (isset($uri['query'])) {
$url->addQuery(isset($uri['query']) ? $uri['query'] : null);
}

$fragment = parse_url($original, PHP_URL_FRAGMENT);

Expand Down

0 comments on commit 496765a

Please sign in to comment.