src/Domain/Value/Identifier/Uri.php
public static function parse(string $uri): Uri
    {
        preg_match(static::URI_PATTERN, $uri, $matches);

        $components = static::componentsFromMatches($matches);
        $scheme = $components['scheme'];
        $authority = $components['authority'];
        $path = $components['path'];
        $query = $components['query'];
        $fragment = $components['fragment'];

        return new static($path, $scheme, $authority, $query, $fragment);
    }
public static function parse(string $uri): Uri
    {
        preg_match(static::URI_PATTERN, $uri, $matches);

        $components = static::componentsFromMatches($matches);
        $scheme = $components['scheme'];
        $authority = $components['authority'];
        $path = $components['path'];
        $query = $components['query'];
        $fragment = $components['fragment'];

        return new static($path, $scheme, $authority, $query, $fragment);
    }
public static function parse ( string $ uri ) : Uri { preg_match ( static :: URI_PATTERN , $ uri , $ matches ) ; $ components = static :: componentsFromMatches ( $ matches ) ; $ scheme = $ components [ 'scheme' ] ; $ authority = $ components [ 'authority' ] ; $ path = $ components [ 'path' ] ; $ query = $ components [ 'query' ] ; $ fragment = $ components [ 'fragment' ] ; return new static ( $ path , $ scheme , $ authority , $ query , $ fragment ) ; }
Creates instance from a URI string

@param string $uri A URI string

@return Uri

@throws DomainException When the URI string is invalid
Creates instance from a URI string