src/Routing/src/UrlGenerator.php
private function buildRouteUri(RouteContract $route, array $variables = [], array $query = []): UriInterface
    {
        $uri = $this->uri
            ->withScheme($route->scheme() ?: $this->request->getUri()->getScheme())
            ->withHost($route->host() ?: $this->request->getUri()->getHost())
            ->withPath($route->compilePath($variables));

        if ($query) {
            $uri = $uri->withQuery(http_build_query($query));
        }

        return $this->addPortToUri($uri);
    }
private function buildRouteUri(RouteContract $route, array $variables = [], array $query = []): UriInterface
    {
        $uri = $this->uri
            ->withScheme($route->scheme() ?: $this->request->getUri()->getScheme())
            ->withHost($route->host() ?: $this->request->getUri()->getHost())
            ->withPath($route->compilePath($variables));

        if ($query) {
            $uri = $uri->withQuery(http_build_query($query));
        }

        return $this->addPortToUri($uri);
    }
private function buildRouteUri ( RouteContract $ route , array $ variables = [ ] , array $ query = [ ] ) : UriInterface { $ uri = $ this -> uri -> withScheme ( $ route -> scheme ( ) ? : $ this -> request -> getUri ( ) -> getScheme ( ) ) -> withHost ( $ route -> host ( ) ? : $ this -> request -> getUri ( ) -> getHost ( ) ) -> withPath ( $ route -> compilePath ( $ variables ) ) ; if ( $ query ) { $ uri = $ uri -> withQuery ( http_build_query ( $ query ) ) ; } return $ this -> addPortToUri ( $ uri ) ; }
Builds URI for provided route instance.

@param RouteContract $route
@param array $variables
@param array $query
@return UriInterface
Builds URI for provided route instance .