Initialize a short chained call.
@param string $uri
@return \OtherCode\Rest\Rest
545309
public static function call($uri)
    {
        return new \OtherCode\Rest\Rest(new \OtherCode\Rest\Core\Configuration(array(
            'url' => $uri
        )));
    }
901887
public static function create($uri)
    {
        if (($parse = parse_url($uri)) === false) {
            throw new \InvalidArgumentException('Unable to parse URI');
        }

        return new Uri(
            isset($parse[ 'scheme' ])
                ? $parse[ 'scheme' ]
                : '',
            isset($parse[ 'host' ])
                ? $parse[ 'host' ]
                : '',
            isset($parse[ 'path' ])
                ? $parse[ 'path' ]
                : '',
            isset($parse[ 'port' ])
                ? $parse[ 'port' ]
                : '',
            isset($parse[ 'query' ])
                ? $parse[ 'query' ]
                : '',
            isset($parse[ 'fragment' ])
                ? $parse[ 'fragment' ]
                : '',
            isset($parse[ 'user' ])
                ? $parse[ 'user' ]
                : '',
            isset($parse[ 'pass' ])
                ? $parse[ 'pass' ]
                : ''
        );
    }
1003181
public function internalRedirect($uri)
    {
        if (is_string($uri)) {

            // make a new URI instance, then make a new request
            $uri = $this->request->getUri()->withPath($uri);
            return $this->request->withUri($uri);

        } elseif ($uri instanceof UriInterface) {

            // get a new request with the specified URI instance
            return $this->request->withUri($uri);

        } else {

            // bad $uri value
            throw new InvalidArgumentException(
                'URI should be a string or instance of Psr\Http\Message\UriInterface'
            );

        }
    }
610442
public function callStaticRoute($uri)
    {
        $params = array_slice($this->getUrlSegments(), 2);

        return $this->callController([$uri, $params]);
    }
969474
protected function get($uri, array $params = [])
    {
        $this->call('GET', $uri, $params, [], $this->cookies, $this->headers);

        return $this;
    }
345991
public function load(UriInterface $uri)
    {
        if (!$uri instanceof HttpUriInterface) {
            throw new InvalidUriTypeException(
                $uri,
                'Eloquent\Schemer\Uri\HttpUriInterface'
            );
        }
        if (!$uri->isAbsolute()) {
            throw new RelativeUriException($uri);
        }

        $response = $this->browser()->get($uri->toString());
        if (!$response->isSuccessful()) {
            throw new LoadException($uri);
        }

        $mimeType = $this->mimeTypeByResponse($response);
        if (null === $mimeType) {
            $mimeType = $this->extensionMap()->getByPath(
                $this->pathFromUri($uri)
            );
        }

        return new Content($response->getContent(), $mimeType);
    }
243290
protected function prepareUrlForRequest($uri)
    {
        if (Str::startsWith($uri, '/')) {
            $uri = substr($uri, 1);
        }

        if (! Str::startsWith($uri, 'http')) {
            $uri = ($this->baseUrl ?? config('app.url')) . '/' . $uri;
        }

        return trim($uri, '/');
    }
1128407
public static function loadFromProvisioningUri(string $uri): OTPInterface
    {
        $parsed_url = parse_url($uri);
        Assertion::isArray($parsed_url, 'Not a valid OTP provisioning URI');
        self::checkData($parsed_url);

        $otp = self::createOTP($parsed_url);

        self::populateOTP($otp, $parsed_url);

        return $otp;
    }
418394
public function withUri(UriInterface $uri, $preserveHost = false)
    {
        $new = self::create($uri);
        if ($preserveHost) {
            $new->headers->set('HOST', $this->getHost());
        }

        return $new;
    }
992298
public function setUri($uri): self
    {
        $this->uri = $uri instanceof Uri ? $uri : new Uri($uri);

        return $this;
    }
684394
public function createAbsoluteUrl($uri)
    {
        if (!isset($uri)) {
            return null;
        }

        $uri = strval($uri);
        if ($this->isRelativeUri($uri)) {
            $parts = parse_url($uri);
            $path  = isset($parts['path']) ? $parts['path'] : '';
            $query = isset($parts['query']) ? $parts['query'] : '';
            $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';

            return $this->baseUrl()->withPath($path)->withQuery($query)->withFragment($hash);
        }

        return $uri;
    }
157910
public static function fromInvalidUri($uri)
    {
        return new self(sprintf('Expected data to be a valid URI object; received "%s"', is_object($uri) ? get_class($uri) : gettype($uri)));
    }
625297
public function fromString($uri)
    {
        if (is_numeric($uri)) { //Could be a valid url
            $uri = '' . $uri;
        }
        if (!is_string($uri)) {
            $uri = '';
        }
        $this->setRelative();
        if (0 === strpos($uri, '//')) {
            $this->setAbsolute();
        }
        $parsed_url = parse_url($uri);
        if (!$parsed_url) {
            return $this;
        }
        if (array_key_exists('scheme', $parsed_url)) {
            $this->setAbsolute();
        }
        foreach ($parsed_url as $urlPart => $value) {
            $method = 'set' . ucfirst($urlPart);
            if (method_exists($this, $method)) {
                $this->$method($value);
            }
        }
        return $this;
    }
1183271
protected function getUriInterface($uri)
    {
        if ($uri instanceof UriInterface) {
            return UriInterface::class;
        }

        if ($uri instanceof Uri) {
            return Uri::class;
        }

        throw Exception::fromInvalidUri($uri);
    }
1091092
public function parse($uri)
    {
        parent::parse($uri);

        if (empty($this->path)) {
            $this->path = '/';
        }

        return $this;
    }
533936
public function createFromUri(UriInterface $uri)
    {
        $pointer = $uri->getFragment();
        if (null === $pointer || '/' !== substr($pointer, 0, 1)) {
            return new Pointer;
        }

        return $this->create($pointer);
    }
682560
public function createRelative($uri = null)
    {
        if (empty($uri)) {
            // Empty uri means baseurl
            return $this->baseUrl;
        } elseif (substr($uri, 0, 7) == "http://"
            || substr($uri, 0, 8) == "https://"
            || substr($uri, 0, 2) == "//"
        ) {
            // Fully qualified, just leave as is.
            return rtrim($uri, '/');
        } elseif ($uri[0] == '/') {
            // Absolute url, prepend with siteUrl
            return rtrim($this->siteUrl . rtrim($uri, '/'), '/');
        }

        $uri = rtrim($uri, '/');
        return $this->baseUrl . '/' . $uri;
    }