public static function createFromComponents(array $components = []): self
    {
        $components += [
            'scheme' => null, 'user' => null, 'pass' => null, 'host' => null,
            'port' => null, 'path' => '', 'query' => null, 'fragment' => null,
        ];

        return new self(
            $components['scheme'],
            $components['user'],
            $components['pass'],
            $components['host'],
            $components['port'],
            $components['path'],
            $components['query'],
            $components['fragment']
        );
    }
public static function createFromComponents(array $components = []): self
    {
        $components += [
            'scheme' => null, 'user' => null, 'pass' => null, 'host' => null,
            'port' => null, 'path' => '', 'query' => null, 'fragment' => null,
        ];

        return new self(
            $components['scheme'],
            $components['user'],
            $components['pass'],
            $components['host'],
            $components['port'],
            $components['path'],
            $components['query'],
            $components['fragment']
        );
    }
public static function createFromComponents ( array $ components = [ ] ) : self { $ components += [ 'scheme' => null , 'user' => null , 'pass' => null , 'host' => null , 'port' => null , 'path' => '' , 'query' => null , 'fragment' => null , ] ; return new self ( $ components [ 'scheme' ] , $ components [ 'user' ] , $ components [ 'pass' ] , $ components [ 'host' ] , $ components [ 'port' ] , $ components [ 'path' ] , $ components [ 'query' ] , $ components [ 'fragment' ] ) ; }
Create a new instance from a hash of parse_url parts.

Create an new instance from a hash representation of the URI similar
to PHP parse_url function result
Create a new instance from a hash of parse_url parts .