aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-15 09:10:16 +0900
committernsfisis <nsfisis@gmail.com>2026-08-15 09:10:16 +0900
commit9e5bb3e4253dda96345f4d1a3421077a72295048 (patch)
tree73237dd78c22e93fe6562a434bb5ffcb03055250 /crates/shirabe-php-shim/src
parent8724f55749a97fe6a6e232d1dd900a069f9b7533 (diff)
downloadphp-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.tar.gz
php-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.tar.zst
php-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.zip
refactor(php-shim): take only the data argument in http_build_query
`http_build_query` ignores `numeric_prefix` because a string-keyed slice never holds an integer key, and every caller passes `"&"` as the separator. Drop both parameters and hard-code the separator. Callers that pass a map of scalar literals to `http_build_query_mixed` no longer need to build an `IndexMap<String, PhpMixed>` for it, so move them to the slice form. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src')
-rw-r--r--crates/shirabe-php-shim/src/url.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/shirabe-php-shim/src/url.rs b/crates/shirabe-php-shim/src/url.rs
index 27463ce0..c2ac725d 100644
--- a/crates/shirabe-php-shim/src/url.rs
+++ b/crates/shirabe-php-shim/src/url.rs
@@ -95,14 +95,8 @@ pub fn http_build_query_mixed(
encode_pairs(&pairs, arg_separator)
}
-pub fn http_build_query(
- data: &[(&str, &str)],
- numeric_prefix: &str,
- arg_separator: &str,
-) -> String {
- // numeric_prefix only applies to integer keys, which a string-keyed slice never has.
- let _ = numeric_prefix;
- encode_pairs(data, arg_separator)
+pub fn http_build_query(data: &[(&str, &str)]) -> String {
+ encode_pairs(data, "&")
}
fn encode_pairs<T: serde::Serialize>(pairs: T, arg_separator: &str) -> String {