@param UriInterface $uri

@return PointerInterface|null
540620
public function pointerByUri(UriInterface $uri)
    {
        $uriPointerMap = $this->createUriPointerMap($uri);

        foreach ($this->map() as $tuple) {
            list($mappingPointer, $mappingUri) = $tuple;
            $mappingUriString = $mappingUri->toString();

            foreach ($uriPointerMap as $tuple) {
                list($uriString, $atoms) = $tuple;

                if ($uriString === $mappingUriString) {
                    return $mappingPointer->joinAtomSequence($atoms);
                }
            }
        }

        return null;
    }
971520
protected function resolveExternal(
        UriInterface $referenceUri,
        Value\ReferenceValue $reference
    ) {
        try {
            $value = $this->reader()->read(
                $this->uriFactory()->create(
                    $referenceUri->toString()
                ),
                $reference->mimeType()
            );
        } catch (ReadException $e) {
            throw new Exception\UndefinedReferenceException(
                $reference,
                $this->currentBaseUri(),
                $e
            );
        }

        $this->pushScopeMap(
            $this->scopeMapFactory()->create($referenceUri, $value)
        );
        $value = $value->accept($this);
        $this->popScopeMap();

        $referencePointer = $this->pointerFactory()->createFromUri(
            $referenceUri
        );
        if ($referencePointer->hasAtoms()) {
            $value = $this->pointerResolver()->resolve(
                $referencePointer,
                $value
            );

            if (null === $value) {
                throw new Exception\UndefinedReferenceException(
                    $reference,
                    $this->currentBaseUri()
                );
            }
        }

        return $value;
    }
689731
protected function updateOptions(UriInterface $uri)
    {
        $query = $this->options['query'];
        if ($this->options['reuseParams']) {
            $query = array_merge(
                $query,
                $this->request->getQueryParams()
            );
        }
        $queryString = http_build_query($query);
        $uri = $uri->withQuery($queryString);
        return $this->updateHostName($uri);
    }
940149
private function decorate(UriInterface $uri = null)
    {
        foreach ($this->decorators as $decorator) {
            $decorator->decorate($uri);
        }
    }
275980
private function getMetaRedirectUriFromResponse(
        ResponseInterface $response,
        UriInterface $lastRequestUri
    ): ?UriInterface {
        /* @var WebPage $webPage */
        try {
            $webPage = Webpage::createFromResponse($lastRequestUri, $response);
        } catch (\Exception $exception) {
            return null;
        }

        $redirectUrl = null;
        $selector = 'meta[http-equiv=refresh]';

        /** @noinspection PhpUnhandledExceptionInspection */
        $inspector = new WebPageInspector($webPage);

        /* @var \DOMElement[] $metaRefreshElements */
        $metaRefreshElements = $inspector->querySelectorAll($selector);

        foreach ($metaRefreshElements as $metaRefreshElement) {
            if ($metaRefreshElement->hasAttribute('content')) {
                $contentAttribute = $metaRefreshElement->getAttribute('content');
                $urlMarkerPosition = stripos($contentAttribute, 'url=');

                if ($urlMarkerPosition !== false) {
                    $redirectUrl = substr($contentAttribute, $urlMarkerPosition + strlen('url='));
                }
            }
        }

        if (empty($redirectUrl)) {
            return null;
        }

        return AbsoluteUrlDeriver::derive($lastRequestUri, new Uri($redirectUrl));
    }
797316
public function createUriFromGlobal(): UriInterface{
        return $this->createUri(
            $this->resolveScheme()
            . "://"
            . $this->resolveAuthority()
            . $this->resolvePathAndQuery()
        );
    }
761281
private function buildHost(UriInterface $uri): string
    {
        return $uri->getHost().($uri->getPort() !== null ? ':'.$uri->getPort() : '');
    }
733934
protected function appendSeoTerms(UriInterface $uri): UriInterface
    {
        if (!empty($this->seoTerms)) {
            $uri = $uri->withPath($uri->getPath().'/'.implode('/', $this->seoTerms));
        }

        return $uri;
    }
240948
public function toAbsoluteUri(UriInterface $uri)
    {
        $uri = $uri->withQuery($this->query);
        $uri = (string)$uri;
        $this->session->saveViewData();

        return $this->response
            ->withStatus(302)
            ->withHeader('Location', $uri);
    }
223397
public function resolveLinks(UriInterface $base)
    {
        $this->resolveLinkAttribute('href', $base);
        $this->resolveLinkAttribute('src', $base);
        $this->resolveLinkAttribute('action', $base);

        return $this;
    }
500425
public static function isAbsolutePathReference(UriInterface $uri)
    {
        $uriPath = $uri->getPath();
        return $uri->getScheme() === ''
            && $uri->getAuthority() === ''
            && isset($uriPath[0])
            && $uriPath[0] === '/';
    }
1022342
public function cookieDomain(UriInterface $uri): ?string
    {
        $host = $uri->getHost();
        if (empty($host)) {
            return null;
        }

        $pattern = $this->config['cookies']['domain'];
        if (preg_match("/^(\d{1,3}){4}:\d+$/", $host, $matches)) {
            // remove port
            $host = $matches[1];
        }

        if (filter_var($host, FILTER_VALIDATE_IP) || $host == 'localhost') {
            //We can't use sub-domains when website required by IP
            $pattern = ltrim($pattern, '.');
        }

        if (strpos($pattern, '%s') === false) {
            //Forced domain
            return $pattern;
        }

        return sprintf($pattern, $host);
    }
769310
public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface
    {
        $clone = clone $this;
        $clone->uri = $uri;

        if ($uri->getHost() !== '') {
            $clone->headers->set('Host', $uri->getHost());
        }

        return $clone;
    }
436672
public function setBase(UriInterface $uri)
    {
        if (! $this->parser->isAbsolute($uri)) {
            throw new InvalidArgumentException('The base URI must be absolute.');
        }

        $this->base = $uri;

        return $this;
    }
910074
public static function getDomain($uri)
    {
        $returnValue = parse_url($uri, PHP_URL_HOST);
        if (empty($returnValue)) {
            return null;
        }

        return $returnValue;
    }
1087473
public function load(UriInterface $uri)
    {
        if (!$uri instanceof FileUriInterface) {
            throw new InvalidUriTypeException(
                $uri,
                'Eloquent\Schemer\Uri\FileUriInterface'
            );
        }

        $path = $this->pathFromUri($uri);

        try {
            $data = $this->isolator->file_get_contents($path);
        } catch (ErrorException $e) {
            throw new LoadException($uri, $e);
        }

        return new Content($data, $this->extensionMap()->getByPath($path));
    }
1052868
public function load(UriInterface $uri)
    {
        $scheme = $uri->getScheme();
        if (null === $scheme) {
            $scheme = $this->defaultScheme();
        }

        return $this->loaderByScheme($scheme)->load($uri);
    }