src/HttpFactory.php
public function createUri(string $uri = ''): UriInterface
    {
        if (is_string($uri)) {
            return Uri::createFromString($uri);
        } else {
            throw new \InvalidArgumentException('Not valid URI given');
        }
    }
public function createUri(string $uri = ''): UriInterface
    {
        if (is_string($uri)) {
            return Uri::createFromString($uri);
        } else {
            throw new \InvalidArgumentException('Not valid URI given');
        }
    }
Create a new URI.

@param string $uri The URI to parse.

@return \Psr\Http\Message\UriInterface
@throws \InvalidArgumentException If the given URI cannot be parsed.