protected function marshalInstance(array $parts)
    {
        $this->scheme = array_key_exists('scheme', $parts)
            ? $this->marshalScheme($parts['scheme'])
            : ''
        ;

        $this->userInfo = $parts['user'] ?? null;

        if ( array_key_exists('pass', $parts) ) {
            $this->userInfo .= ':'.$parts['pass'];
        }

        $this->host = array_key_exists('host', $parts)
            ? $this->marshalHost($parts['host'])
            : $this->host
        ;

        $this->port = array_key_exists('port', $parts)
            ? $this->marshalPort($parts['port'])
            : null
        ;

        $this->path = array_key_exists('path', $parts)
            ? $this->marshalPath($parts['path'])
            : '/'
        ;

        $this->query = array_key_exists('query', $parts)
            ? $this->marshalQueryAndFragment($parts['query'])
            : null
        ;

        $this->fragment = array_key_exists('fragment', $parts)
            ? $this->marshalQueryAndFragment($parts['fragment'])
            : null
        ;

        if ( empty($this->scheme) && ! array_key_exists('host', $parts) && ! array_key_exists('port', $parts) ) {
            $this->scheme = 'http';
        }

        $this->calibratePort();
    }