Check and construct an real URL to make request

@param $resource
@param array $query
@return string
170988
public function makeUrl($resource)
    {
        $uri = self::$IUGU_URL_API;
        if (! preg_match("/^https/", $resource)) {
            if (! preg_match("/^\//", $resource)) {
                $resource = '/' . $resource;
            }
        }
        $uri .= $resource;

        return $uri;
    }
1200547
public function get($url, array $query = [], array $headers = [])
    {
        return $this->execute('GET', $this->buildGetUrl($url, $query), [], $headers);
    }
279414
protected function parseGet($url, $query)
        {
            $append = strpos($url, '?') === false ? '?' : '&';

            return $url . $append . http_build_query($query);
        }
828114
public function urlPagination($pagination, array $query = [])
    {
        $query[MbDatabaseQueryBuilder::getPagination()] = $pagination;
        $query = array_replace($this->query(), $query);

        return $this->url() . '?' . http_build_query($query);
    }
1044017
protected function buildHttpQuery(array $parameters):string
    {
        return http_build_query(
            array_map(
                function ($parameter) {
                    if (! is_bool($parameter)) {
                        return $parameter;
                    }

                    return $parameter ? 'true' : 'false';
                },
                $parameters
            )
        );
    }
70869
public function get($url, array $query = [])
    {
        $url = $this->buildUrl($url, $query);
        $handle = $this->getHandler();

        return $this->run($handle, $url);
    }
573454
public function uri($query = false)
    {
        return rtrim($this->baseName(), '/') . '/' . ltrim($this->path($query), '/');
    }
1238281
public function current(array $query = array())
    {
        if(!$this->request)
            throw new \Exedra\Exception\InvalidArgumentException('Http Request does not exist.');

        $uri = $this->request->getUri();

        if(count($query) > 0)
        {
            // append query to uri
            if($uri->getQuery())
                $query = http_build_query($query);
            else
                $query = '?' . http_build_query($query);
        }
        else
        {
            $query = '';
        }

        return $this->request->getUri().$query;
    }
1318555
public function createRequestUri($name, array $query = array())
    {
        if (empty($this->routeMapping[$name])) {
            throw new \InvalidArgumentException(sprintf('Unknow request preset under name "%s", only [%s] defined.',
                $name,
                implode('","', array_keys($this->routeMapping))
            ));
        }

        // build request
        return $this->urlGenerator->generate(
            $this->routeMapping[$name],
            $query,
            UrlGeneratorInterface::ABSOLUTE_URL
        );
    }
603738
protected function url($path = '', $query = [])
    {
        $path = $this->urlBase() . $path;
        $query = http_build_query(array_merge($this->params, $query));

        $url = $path;
        if (!empty($query)) {
            $url .= '?' . $query;
        }

        return $url;
    }
964349
protected function prepareQueryForLog(string $query, array $params): string
	{
		return preg_replace_callback('/\?/', function() use (&$params)
		{
			$param = array_shift($params);

			if(is_int($param) || is_float($param))
			{
				return $param;
			}
			elseif(is_bool(($param)))
			{
				return $param ? 'TRUE' : 'FALSE';
			}
			elseif(is_object($param))
			{
				return get_class($param);
			}
			elseif(is_null($param))
			{
				return 'NULL';
			}
			elseif(is_resource($param))
			{
				return 'resource';
			}
			else
			{
				return $this->pdo->quote($param);
			}
		}, $query);
	}
414870
public function fullUrlWithQuery( array $query )
	{
		return count( $this->query() ) > 0 ? $this->url() . '/?' . http_build_query( array_merge( $this->query(), $query ) ) : $this->fullUrl() . '?' . http_build_query( $query );
	}
120422
private function buildGetUrl($url, array $query = [])
    {
        // Merge global and request queries
        $query = array_merge(
            Arr::get($this->config, 'query', []),
            $query
        );

        // Append query
        if ($query = http_build_query($query)) {
            $url .= strpos($url, '?') ? $query : "?{$query}";
        }

        return $url;
    }
1308633
protected function createUrl($query)
    {
        $options = $this->getOptions();
        $path = sprintf(
            'http://translate.google.com/translate_tts?ie=%s&tl=%s&q=%s',
            $options->hasEncoding() ? $options->getEncoding() : 'UTF-8',
            $options->getLanguage(),
            urlencode($query)
        );
        return $path;
    }
434621
function buildHTTPGetQuery( $request, $queryParams )
    {
        foreach ( $queryParams as $name => $value )
        {
            if ( is_array( $value ) )
            {
                foreach ( $value as $valueKey => $valuePart )
                {
                    $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $valuePart );
                }
            }
            else
            {
                $encodedQueryParams[] = urlencode( $name ) . '=' . urlencode( $value );
            }
        }

        return $this->SearchServerURI . $request . '?' . implode( '&', $encodedQueryParams );
    }
1166194
protected function buildQueryString($query)
    {
        if (defined('PHP_QUERY_RFC3986')) {
            return http_build_query($query, null, '&', PHP_QUERY_RFC3986);
        }

        // @codeCoverageIgnoreStart
        return str_replace('+', '%20', http_build_query($query, null, '&'));
        // @codeCoverageIgnoreEnd
    }
73364
protected function appendUrlQuery($url, $query)
    {
        $glue = $this->urlHasQuery($url) ? '&' : '?';

        return $url.$glue.http_build_query($query);
    }