Returns full uri string.

@param   array  $parts  An array specifying the parts to render.

@return  string  The rendered URI string.

@since   1.0
968784
public function toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))
	{
		// Make sure the query is created
		$query = $this->getQuery();

		$uri = '';
		$uri .= in_array('scheme', $parts) ? (!empty($this->scheme) ? $this->scheme . '://' : '') : '';
		$uri .= in_array('user', $parts) ? $this->user : '';
		$uri .= in_array('pass', $parts) ? (!empty($this->pass) ? ':' : '') . $this->pass . (!empty($this->user) ? '@' : '') : '';
		$uri .= in_array('host', $parts) ? $this->host : '';
		$uri .= in_array('port', $parts) ? (!empty($this->port) ? ':' : '') . $this->port : '';
		$uri .= in_array('path', $parts) ? $this->path : '';
		$uri .= in_array('query', $parts) ? (!empty($query) ? '?' . $query : '') : '';
		$uri .= in_array('fragment', $parts) ? (!empty($this->fragment) ? '#' . $this->fragment : '') : '';

		return $uri;
	}
55480
static protected function buildUrlSchemeHostPort(&$parts)
    {
        $return = '';
        if ($parts['scheme'] == 'omit') {
            $parts['scheme'] = null;
        } elseif (!$parts['scheme'] && !$parts['host']) {
            return '';
        } elseif (!$parts['scheme']) {
            // we passed a host, but no scheme
            if (\in_array($parts['host'], array(
                    '127.0.0.1',
                    'localhost',
                    isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : null,
            ))) {
                $local = true;
            } else {
                $regex = '#(.+\.)?(\w+.[a-z])$#';
                $hostDomain = \preg_replace($regex, '$1', $parts['host']);
                $localDomain = \preg_replace($regex, '$1', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : null);
                $local = $hostDomain == $localDomain;
            }
            if ($local) {
                $parts['scheme'] = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on'
                    ? 'https'
                    : 'http';
            } else {
                $parts['scheme'] = 'http';
            }
        } elseif (!\in_array($parts['scheme'], array('http','https'))) {
            $parts = \array_diff_key($parts, \array_flip(array('query','fragment','params')));
        }
        if ($parts['scheme']) {
            $return .= $parts['scheme'].':';
        }
        if ($parts['host']) {
            $return .= '//';
            $parts = \array_merge(array('user'=>null,'pass'=>null), $parts);
            if (!empty($parts['user'])) {
                $return .= $parts['user'].\rtrim(':'.$parts['pass'], ':').'@';
            }
            $return .= $parts['host'];
            if ($parts['port']) {
                $defaultPorts = array(
                    'http' => 80,
                    'https' => 443,
                );
                if ($parts['scheme']) {
                    if (isset($defaultPorts[ $parts['scheme'] ]) && $parts['port'] == $defaultPorts[ $parts['scheme'] ]) {
                        $parts['port'] = null;
                    }
                } elseif (in_array($parts['port'], $defaultPorts)) {
                    $parts['port'] = null;
                }
                $return .= \rtrim(':'.$parts['port'], ':');
            }
        }
        return $return;
    }
1116201
public function getRequestUri($includeParameters = false)
    {
        $uri = $this->uri;

        if (!$includeParameters) {
            $sepIdx = strpos($uri, '?');

            if ($sepIdx !== false) {
                $uri = substr($uri, 0, $sepIdx);
            }
        }

        return $uri;
    }
267443
public static function buildUrl(array $parts)
    {
        $url = $scheme = '';

        if (isset($parts['scheme'])) {
            $scheme = $parts['scheme'];
            $url .= $scheme . ':';
        }

        if (isset($parts['host'])) {
            $url .= '//';
            if (isset($parts['user'])) {
                $url .= $parts['user'];
                if (isset($parts['pass'])) {
                    $url .= ':' . $parts['pass'];
                }
                $url .=  '@';
            }

            $url .= $parts['host'];

            // Only include the port if it is not the default port of the scheme
            if (isset($parts['port'])
                && !(($scheme == 'http' && $parts['port'] == 80) || ($scheme == 'https' && $parts['port'] == 443))
            ) {
                $url .= ':' . $parts['port'];
            }
        }

        // Add the path component if present
        if (isset($parts['path']) && 0 !== strlen($parts['path'])) {
            // Always ensure that the path begins with '/' if set and something is before the path
            if ($url && $parts['path'][0] != '/' && substr($url, -1)  != '/') {
                $url .= '/';
            }
            $url .= $parts['path'];
        }

        // Add the query string if present
        if (isset($parts['query'])) {
            $url .= '?' . $parts['query'];
        }

        // Ensure that # is only added to the url if fragment contains anything.
        if (isset($parts['fragment'])) {
            $url .= '#' . $parts['fragment'];
        }

        return $url;
    }
359438
protected function _getPart($part)
    {
        if (property_exists($this, $part)) {
            return $this->{$part};
        } elseif (!in_array($part, self::$_table_parts)) {
            throw new InvalidArgumentException(
                sprintf('Unknown table part "%s"!', $part)
            );
        }
    }
497560
protected function normalizeParts(array $parts)
    {
        $blockSize = $this->getPartSize();
        $callback  = function ($value) {
            return Util::safeStrlen($value);
        };
        $maxSize = max(array_map($callback, $parts));
        if ($maxSize % $blockSize != 0) {
            $maxSize += $blockSize - ($maxSize % $blockSize);
        }
        foreach ($parts as &$part) {
            $part = $this->str_pad($part, $maxSize, chr(0));
            $part = str_split($part, $blockSize);
        }

        return $parts;
    }
200283
static function buildUrl($parts)
    {
        $parts = new ArrayObject($parts);

        ###################
        ### PARSE PARTS ###
        ###################

        // scheme
        $scheme = $parts->key('scheme', '', true);

        // host
        $host = $parts->key('host', '', true);

        // port
        $port = $parts->key('port', '', true);

        // path
        $path = $parts->key('path', '', true);

        // parse query string
        $query = '';
        if($parts->keyExists('query')) {
            if(self::isString($parts->key('query'))) {
                parse_str($parts->key('query'), $queryData);
            } else {
                $queryData = $parts->key('query');
            }

            if(self::isArray($queryData)) {
                $query = $queryData;
            }
        }


        ###################
        ### BUILD URL   ###
        ###################
        $url = '';

        // scheme
        if($scheme && $scheme != '') {
            $url .= $scheme . '://';
        }

        // host
        if($host && $host != '') {
            $url .= $host;
        }

        // port
        if($port != '') {
            $url .= ':' . $port;
        }

        // path
        if($path != '') {
            $url .= $path;
        }

        // query
        if(self::isArray($query)) {
            $query = http_build_query($query);
            if($query != "") {
                $url .= '?' . $query;
            }
        }

        try {
            return new UrlObject($url);
        } catch (\Exception $e) {
            throw new UrlObjectException($e->getMessage());
        }
    }
1160825
public function getPart($part)
    {
        return isset($this->parts[$part]) ? $this->parts[$part] : null;
    }
1276097
public function render($part = 'content')
    {
        $return = '';
        switch ($part) {
            case 'content':
                $return = $this->renderContent();
                break;
            case 'filter':
                $return = $this->renderFilter();
                break;
            case 'summary':
                $return = $this->renderSummary();
                break;
            case 'header':
                $return = $this->renderHeader();
                break;
        }

        return $return;
    }
510338
protected function multipartFinalize(Array $multiparts = []) {
    $contents = '';
    foreach ($multiparts as $multipart) {
      $contents .= $multipart;
    }
    $contents .= '--' . $this->boundary  . '--';
    $contents .= static::EOL;
    return $contents;
  }
71022
public function getUri()
    {
        $userPart = '';
        if ($this->getUser() !== null && $this->getPass() !== null) {
            $userPart = $this->getUser() . ':' . $this->getPass()  . '@';
        } else if ($this->getUser() !== null) {
            $userPart = $this->getUser() . '@';
        }
        $schemePart = ($this->getScheme() ? $this->getScheme() . '://' : '//');
        if (!in_array($this->getScheme(), self::getSchemesWithAuthority())) {
            $schemePart = $this->getScheme() . ':';
        }
        $portPart = ($this->getPort() ? ':' . $this->getPort() : '');
        $queryPart = ($this->getQuery() ? '?' . $this->getQuery() : '');
        $fragmentPart = ($this->getFragment() ? '#' . $this->getFragment() : '');
        if ($this->isRelative()) {
            return $this->getPath() .
            $queryPart .
            $fragmentPart;
        }
        $path = $this->getPath();
        if (0 !== strlen($path) && '/' !== $path[0]) {
            $path = '/' . $path;
        }
        return $schemePart .
        $userPart .
        $this->getHost() .
        $portPart .
        $path .
        $queryPart .
        $fragmentPart;
    }
177573
protected function buildStepsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'pipelines', $this->pipeline, 'steps', ...$parts);
    }
317272
private static function buildPath($root, array $parts)
    {
        if ($parts === []) {
            return $root === '' ? '.' : $root;
        }

        return $root . implode(DIRECTORY_SEPARATOR, $parts);
    }
263759
protected function processParts(array $parts)
    {
        return array_values(array_filter($parts, function ($part) {
            if (empty($part) || $part instanceof CommentPart) {
                return false;
            }
            return true;
        }));
    }
455997
protected function processParts(array $parts)
    {
        $strValue = '';
        foreach ($parts as $part) {
            $strValue .= $part->getValue();
        }
        return [$this->partFactory->newDatePart($strValue)];
    }
698676
public static function buildUrl($baseUrl, array $parts = [])
    {
        $url = $baseUrl;

        foreach ($parts as $part) {
            if (strpos($part, '/') !== false) {
                @list(,$part) = explode('/', $part);
            }

            $url .= '/' . urlencode($part);
        }

        return $url;
    }
100248
public static function fromParts(array $parts):UriInterface{
		$uri = new self;

		$uri->parseUriParts($parts);
		$uri->validateState();

		return $uri;
	}