function Uri::generateQueryString
2 calls to Uri::generateQueryString()
- Uri::withQueryValue in vendor/
guzzlehttp/ psr7/ src/ Uri.php - Creates a new URI with a specific query string value.
- Uri::withQueryValues in vendor/
guzzlehttp/ psr7/ src/ Uri.php - Creates a new URI with multiple specific query string values.
File
-
vendor/
guzzlehttp/ psr7/ src/ Uri.php, line 662
Class
- Uri
- PSR-7 URI implementation.
Namespace
GuzzleHttp\Psr7Code
private static function generateQueryString(string $key, ?string $value) : string {
// Query string separators ("=", "&") within the key or value need to be encoded
// (while preventing double-encoding) before setting the query string. All other
// chars that need percent-encoding will be encoded by withQuery().
$queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT);
if ($value !== null) {
$queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT);
}
return $queryString;
}