src/Uri.php
public static function createFromString(string $str): self
    {
        $parsedUrl = parse_url($str);

        return new self($parsedUrl['scheme'] ?? '',
                        $parsedUrl['host'] ?? null,
                        $parsedUrl['port'] ?? null,
                        $parsedUrl['path'] ?? '/',
                        $parsedUrl['query'] ?? '',
                        $parsedUrl['fragment'] ?? '',
                        $parsedUrl['user'] ?? '',
                        $parsedUrl['pass'] ?? '');
    }
public static function createFromString(string $str): self
    {
        $parsedUrl = parse_url($str);

        return new self($parsedUrl['scheme'] ?? '',
                        $parsedUrl['host'] ?? null,
                        $parsedUrl['port'] ?? null,
                        $parsedUrl['path'] ?? '/',
                        $parsedUrl['query'] ?? '',
                        $parsedUrl['fragment'] ?? '',
                        $parsedUrl['user'] ?? '',
                        $parsedUrl['pass'] ?? '');
    }
Create Uri object with string

@param string $str

@return \Berlioz\Http\Message\Uri