expand($uri, $variables); } /** * @param string $uri * @param array $query * @return UriInterface */ public function buildUriWithQuery($uri, array $query) { $query = array_filter($query, function ($v) { return $v !== null; }); // @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 foreach ($query as $k => &$v) { if (is_bool($v)) { $v = $v ? 'true' : 'false'; } } return \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\uri_for($uri)->withQuery(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\build_query($query)); } }