Google\Cloud\UriTrait::buildUriWithQuery PHP Method

buildUriWithQuery() public method

public buildUriWithQuery ( string $uri, array $query ) : Psr\Http\Message\UriInterface
$uri string
$query array
return Psr\Http\Message\UriInterface
    public function buildUriWithQuery($uri, array $query)
    {
        // @todo fix this hack. when using build_query booleans are converted to
        // 1 or 0 which the API does not accept. this casts bools to their
        // string representation
        $query = array_filter($query);
        foreach ($query as $k => &$v) {
            if (is_bool($v)) {
                $v = $v ? 'true' : 'false';
            }
        }
        return Psr7\uri_for($uri)->withQuery(Psr7\build_query($query));
    }