@param string $uri

@return Uri
326101
public function parse($uri)
    {
        // Capture scheme
        if (($scheme = static::parseScheme($uri)) !== null) {
            $this->setScheme($scheme);
            $uri = substr($uri, strlen($scheme) + 1);
        }

        // Capture authority part
        if (preg_match('|^//([^/\?#]*)|', $uri, $match)) {
            $authority = $match[1];
            $uri       = substr($uri, strlen($match[0]));

            // Split authority into userInfo and host
            if (strpos($authority, '@') !== false) {
                // The userInfo can also contain '@' symbols; split $authority
                // into segments, and set it to the last segment.
                $segments  = explode('@', $authority);
                $authority = array_pop($segments);
                $userInfo  = implode('@', $segments);
                unset($segments);
                $this->setUserInfo($userInfo);
            }

            $nMatches = preg_match('/:[\d]{1,5}$/', $authority, $matches);
            if ($nMatches === 1) {
                $portLength = strlen($matches[0]);
                $port = substr($matches[0], 1);

                $this->setPort((int) $port);
                $authority = substr($authority, 0, -$portLength);
            }

            $this->setHost($authority);
        }

        if (!$uri) {
            return $this;
        }

        // Capture the path
        if (preg_match('|^[^\?#]*|', $uri, $match)) {
            $this->setPath($match[0]);
            $uri = substr($uri, strlen($match[0]));
        }

        if (!$uri) {
            return $this;
        }

        // Capture the query
        if (preg_match('|^\?([^#]*)|', $uri, $match)) {
            $this->setQuery($match[1]);
            $uri = substr($uri, strlen($match[0]));
        }
        if (!$uri) {
            return $this;
        }

        // All that's left is the fragment
        if ($uri && substr($uri, 0, 1) == '#') {
            if ('#' === $uri) {
                $this->setFragment('');
            } else {
                $this->setFragment(substr($uri, 1));
            }
        }

        return $this;
    }
1009622
protected function _normalizedUrl($uri)
    {
        $out = $uri->getScheme() . '://';
        $out .= strtolower($uri->getHost());
        $out .= $uri->getPath();

        return $out;
    }
482348
public function setUri($uri)
    {
        if (!is_array($uri)) {
            $uri = parse_url($uri);
        }

        $this->uri = $uri;
        return $this;
    }
466565
protected function makeUriRelativeTo($uri, $root)
    {
        if (!$root) {
            return $uri;
        }

        if (is_array($uri)) {
            $uris = [];
            foreach ($uri as $u) {
                $uris[] = $this->makeUriRelativeTo($u, $root);
            }
            return $uris;
        }

        if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) {
            return $uri;
        }
        return rtrim($root, '/') . "/$uri";
    }
18639
public static function uriToPath(string $uri)
    {
        $fragments = parse_url($uri);
        if ($fragments === false || !isset($fragments['scheme']) || $fragments['scheme'] !== 'file') {
            throw new \InvalidArgumentException("Not a valid file URI: $uri");
        }
        $filepath = urldecode((string) $fragments['path']);
        if (strpos($filepath, ':') !== false) {
            if ($filepath[0] === '/') {
                $filepath = substr($filepath, 1);
            }
            $filepath = str_replace('/', '\\', $filepath);
        }
        return $filepath;
    }
944360
public function setUri( $uri )
    {
        $uri = (string) $uri;

        if ( empty( $uri ) )
        {
            $uri = '#';
        }
        else if ( ! preg_match( '(^(' . static::VALID_SCHEMES . '))', $uri ) )
        {
            if ( preg_match( '(^[a-z0-9-]+(\.[a-z0-9-]+)+(/.*)?$)', $uri ) )
            {
                $uri = static::DEFAULT_SCHEME . $uri;
            }
            else
            {
                $uri = '/' . ltrim( $uri, '/' );
            }
        }

        $this->uri = $uri;
        return $this;
    }
1058112
public function getUri($uri) {
        $curieSeperator = ':';

        if (preg_match('/http(s*)\:\/\//', $uri) == false) {
            if (strpos($uri, $curieSeperator) !== false) {
                list($prefix, $action) = explode($curieSeperator, $uri);
                
                if(isset($this->WAMP->prefixes[$prefix]) === true){
                  return $this->WAMP->prefixes[$prefix] . '#' . $action;
                }
            }
        }

        return $uri;
    }
1016646
public function findByUri($uri)
	{
		return $this->routes->first(function ($route) use($uri) {

			return $route->match($uri);
		});
	}
198687
public function getUriWithExtraString(string $uri): String
    {
        if (!$this->queryString) {
            return $uri;
        }

        return $uri . '?' . implode('&', $this->queryString);
    }
437845
public static function hostToAscii($uri)
    {
        return $uri->withHost((string) (new Host(self::filterUri($uri)->getHost())));
    }
476991
public function delete(string $uri)
    {
        $request = $this->getRequest($uri)
            ->setMethod('DELETE');

        return $this->send($request);
    }
42635
private function getCompleteUrl($uri = '')
    {
        $uri = $uri === '' ? $this->urlResolver->getPath() : $uri;
        $url = sprintf('%s%s', $this->urlResolver->getDomain(), $uri);

        if ($this->isGet() && $this->GET) {
            $url = sprintf('%s?%s', $url, http_build_query($this->GET->getAll()));
        }

        return $url;
    }
314284
protected function fromString($uri)
    {
        if (empty($uri)) {
            return $this;
        }

        $this->fromArray(parse_url($uri));

        return $this;
    }
1302498
public static function hostToUnicode($uri)
    {
        return $uri->withHost((string) (new Host(self::filterUri($uri)->getHost()))->toUnicode());
    }
301139
public static function createFromString (string $uri)
    {
        $parts = parse_url($uri);
        $scheme = isset($parts['scheme']) ? $parts['scheme'] : '';
        $user = isset($parts['user']) ? $parts['user'] : '';
        $pass = isset($parts['pass']) ? $parts['pass'] : '';
        $host = isset($parts['host']) ? $parts['host'] : '';
        $port = isset($parts['port']) ? $parts['port'] : null;
        $path = isset($parts['path']) ? $parts['path'] : '';
        $query = isset($parts['query']) ? $parts['query'] : '';
        $fragment = isset($parts['fragment']) ? $parts['fragment'] : '';

        return new \Resilient\Http\Uri($scheme, $host, $port, $path, $query, $fragment, $user, $pass);
    }
1294863
private function setUri($uri)
    {
        $this->uri = $uri;

        preg_match_all('/({[^}]+})/', $this->uri, $matches);
        $this->params = $matches[0];

        return $this;
    }
521968
public function analyseURI($uri)
    {
        $uriElements = '/' . implode('/', $this->getURIElements());
        if ($uri == $uriElements) {
            $uri = '';
        } elseif (strpos($uri, $uriElements) === 0) {
            $uri = mb_substr($uri, mb_strlen($uriElements));
        }

        return $uri;
    }