src/Http/Uri.php
private function buildFromParts(array $parts)
    {
        $this->withScheme(isset($parts['scheme']) ? $parts['scheme'] : '')
            ->withUserInfo(
                isset($parts['user']) ? $parts['user'] : '',
                isset($parts['pass']) ? ':'.$parts['pass'] : null
            )
            ->withHost(isset($parts['host']) ? $parts['host'] : '')
            ->withPort(!empty($parts['port']) ? $parts['port'] : null)
            ->withPath(isset($parts['path']) ? $parts['path'] : '')
            ->withQuery(isset($parts['query']) ? $parts['query'] : '')
            ->withFragment(isset($parts['fragment']) ? $parts['fragment'] : '');
    }
private function buildFromParts(array $parts)
    {
        $this->withScheme(isset($parts['scheme']) ? $parts['scheme'] : '')
            ->withUserInfo(
                isset($parts['user']) ? $parts['user'] : '',
                isset($parts['pass']) ? ':'.$parts['pass'] : null
            )
            ->withHost(isset($parts['host']) ? $parts['host'] : '')
            ->withPort(!empty($parts['port']) ? $parts['port'] : null)
            ->withPath(isset($parts['path']) ? $parts['path'] : '')
            ->withQuery(isset($parts['query']) ? $parts['query'] : '')
            ->withFragment(isset($parts['fragment']) ? $parts['fragment'] : '');
    }
Apply parse_url parts to a URI.

@param $parts array of parse_url parts.