Build the patches path from the given parts.

@param string[] $parts

@throws \Bitbucket\Exception\InvalidArgumentException

@return string
965092
protected function buildPatchesPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, $this->repo, 'patch', ...$parts);
    }
251880
protected function buildAttachmentsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'issues', $this->issue, 'attachments', ...$parts);
    }
1234869
public static function fromArray(array $pathParts)
    {
        if (0 === count($pathParts)) {
            $path = '';
        } else {
            $pathParts = self::escape($pathParts);
            $path = '/'.implode('/', $pathParts);
        }

        return new static($path);
    }
568497
protected function buildBuildPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'commit', $this->commit, 'statuses', 'build', ...$parts);
    }
551661
private function buildQuery($parts)
    {
        $return = array();
        foreach ($parts as $key => $value) {
            if (is_array($value)) {
                foreach ($value as $v) {
                    $return[] = urlencode($key) . "=" . urlencode($v);
                }
                continue;
            }
            $return[] = urlencode($key) . "=" . urlencode($value);
        }
        return implode('&', $return);
    }
551532
private function applyParts(array $parts = [])
    {
        $this->scheme = array_key_exists('scheme', $parts) ? $this->filterScheme($parts['scheme']) : null;
        $this->userInfo = array_key_exists('user', $parts) ? $parts['user'] : null;
        $this->host = array_key_exists('host', $parts) ? $parts['host'] : null;
        $this->port = array_key_exists('port', $parts) ? $this->filterPort($this->getScheme(), $this->getHost(), $parts['port']) : null;
        $this->path = array_key_exists('path', $parts) ? $this->filterPath($parts['path']) : null;
        $this->query = array_key_exists('query', $parts) ? $this->filterQueryAndFragment($parts['query']) : null;
        $this->fragment = array_key_exists('fragment', $parts) ? $this->filterQueryAndFragment($parts['fragment']) : null;
        $this->userInfo .= array_key_exists('pass', $parts) ? ':' . $parts['pass'] : null;
    }
839001
private function composeName(array $parts)
    {
        $name = array_shift($parts);

        while (! empty($parts)) {
            $part = array_shift($parts);
            $name .= "[$part]";
        }

        return $name;
    }
578626
public static function generateQueryString(array $parts)
    {
        $return = "";

        foreach ($parts as $part) {
            if ($part instanceof Table) {
                $return .= "`{$part->getTableName()}`";
                if ($part->getTableAs() !== null) {
                    $return .= " " . $part->getTableAs();
                }

                $return .= ",";
            }
        }

        return ($return !== "" ? substr($return, 0, -1) : "*");
    }
1168702
final public function createTraitFromStringArray(array $parts) : Trait_
    {
        return new Trait_(
            $this->extractClazzPart($parts),
            new Namespaze($this->extractNamespaceParts($parts))
        );
    }
342497
public static function buildFromParseUrlParts(array $parts) {
        $url = '';

        $url .= isset($parts['scheme']) ? $parts['scheme'] : 'http';
        $url .= '://';

        if (isset($parts['user'])) {
            $url .= $parts['user'];

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

            $url .= '@';
        }

        $url .= isset($parts['host']) ? $parts['host'] : '';
        $url .= isset($parts['port']) ? ':' . $parts['port'] : '';
        $url .= isset($parts['path']) ? $parts['path'] : '';
        $url .= isset($parts['query']) ? '?' . $parts['query'] : '';
        $url .= isset($parts['fragment']) ? '#' . $parts['fragment'] : '';

        return $url;
    }
465512
public static function create(array $parts)
    {
        if (0 === \count($parts)) {
            throw new CrunzException('At least one part expected.');
        }

        $normalizedPath = \str_replace(
            DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
            DIRECTORY_SEPARATOR,
            \implode(DIRECTORY_SEPARATOR, $parts)
        );

        return new self($normalizedPath);
    }
1192534
public function prepend(string ...$parts): self
    {
        array_push($parts, $this->path);

        return self::make(...$parts);
    }
715809
public function addParts($parts): CompositeBuilder
    {
        foreach ($parts as $part) {
            $this->addPart($part);
        }

        return $this;
    }
177573
protected function buildStepsPath(string ...$parts)
    {
        return static::buildPath('repositories', $this->username, $this->repo, 'pipelines', $this->pipeline, 'steps', ...$parts);
    }
174282
protected function implodeSQL(array $parts): string
    {
        $result = '';
        foreach ($parts as $part) {
            if ($part === '') {
                continue;
            }

            $result .= ($result === '' ? '' : "\n").$part;
        }

        return $result;
    }
212905
function build_url( $parts = null )
	{
		if (is_string($parts))
		{
			if ($parts === '' || $parts === '//')
				return $this->uri->withScheme(null);								//	'//' . $this->uri->authority . $this->uri->getPathAndQuery();
			if ($parts[0] === '/')
				return $this->uri->getLeftPart(Uri::PARTIAL_AUTHORITY) . $parts;	//	(_::is_https() ? 'https://' : 'http://') . _::request('host') . $parts;
			if ($parts === 'https' || $parts === 'http')
				return $this->uri->withScheme($parts);								//	$parts . '://' . _::request('host') . _::request('uri');
			if ($parts[0] === '?')
				return $this->uri->getLeftPart(Uri::PARTIAL_PATH) . $parts;			//	(_::is_https() ? 'https://' : 'http://') . _::request('host') . _::request('path') . $parts;
			if (strpos($parts, '=') !== false)
				return $this->uri->getLeftPart(Uri::PARTIAL_PATH) . '?' . $parts;	//	(_::is_https() ? 'https://' : 'http://') . _::request('host') . _::request('path') . '?' . $parts;
			if ($parts[0] === '#')
				return $this->uri->withFragment($parts);							//	(_::is_https() ? 'https://' : 'http://') . _::request('host') . _::request('uri') . $parts;
			throw new \Exception("Invalid call to Request::build_url('{$parts}')");
		}
		return (string) (new Uri($parts));
/*
		return	(isset($parts['scheme']) ? (empty($parts['scheme']) ? '//' : $parts['scheme'] . '://') : ($this->uri->scheme ?? 'http') : 'http://')) .	// Can set `scheme` to NULL to generate a Protocol-Relative-URL!
				'//' . (empty($parts['host']) ? $this->uri->authority : $parts['host']) .
				(empty($parts['path']) ? _::request('path') : $parts['path']) .
				(isset($parts['query']) ? (empty($parts['query']) ? null : '?' . $parts['query']) : (empty($parts['path']) && _::request('query') ? '?' . _::request('query') : null)); // NO FRAGMENT! We can append it if we really need it!
*/
	}
354964
protected function mapParts(array $parts): array
    {
        $k = $this->skipIgnoredParts($parts) + 1;
        $remapIgnored = true;

        while (--$k >= 0) {
            $part = $parts[$k];

            if ($part instanceof AbstractPart) {
                break;
            }

            if ($this->isFollowedByLastnamePart($parts, $k)) {
                if ($this->isApplicablePrefix($parts, $k)) {
                    $parts[$k] = new LastnamePrefix($part, $this->prefixes[$this->getKey($part)]);
                    continue;
                }

                if ($this->shouldStopMapping($parts, $k)) {
                    break;
                }
            }

            $parts[$k] = new Lastname($part);
            $remapIgnored = false;
        }

        if ($remapIgnored) {
            $parts = $this->remapIgnored($parts);
        }

        return $parts;
    }