diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 12:51:24 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 12:51:24 +0900 |
| commit | fce44d4587ba11b080fe0266c483d0be684ffd0d (patch) | |
| tree | 753e87ac7ed2e57d635a60c10a4ce01b7e0f0f8e /crates/shirabe/src/util/remote_filesystem.rs | |
| parent | b12c2b15f0487d54d359a581e99ced68713914d0 (diff) | |
| download | php-shirabe-fce44d4587ba11b080fe0266c483d0be684ffd0d.tar.gz php-shirabe-fce44d4587ba11b080fe0266c483d0be684ffd0d.tar.zst php-shirabe-fce44d4587ba11b080fe0266c483d0be684ffd0d.zip | |
refactor(php-shim): split json_decode into assoc and obj variants
The assoc flag was always a literal at every call site, so the boolean
carried no information the function name could not. json_decode_assoc
and json_decode_obj make the resulting PhpMixed shape visible at the
call site.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/remote_filesystem.rs')
| -rw-r--r-- | crates/shirabe/src/util/remote_filesystem.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs index 61165b28..4a8ca267 100644 --- a/crates/shirabe/src/util/remote_filesystem.rs +++ b/crates/shirabe/src/util/remote_filesystem.rs @@ -19,7 +19,7 @@ use shirabe_php_shim::{ PhpMixed, RuntimeException, STREAM_NOTIFY_FAILURE, STREAM_NOTIFY_FILE_SIZE_IS, STREAM_NOTIFY_PROGRESS, array_replace_recursive, base64_encode, explode, extension_loaded, file_get_contents, file_get_contents5, file_put_contents, filter_var_boolean, gethostbyname, - http_clear_last_response_headers, http_get_last_response_headers, ini_get, json_decode, + http_clear_last_response_headers, http_get_last_response_headers, ini_get, json_decode_assoc, parse_url, php_regex, preg_quote, strpos, strtolower, strtr, substr, trim, zlib_decode, }; @@ -336,7 +336,7 @@ impl RemoteFilesystem { { let parsed = result .as_deref() - .map(|s| json_decode(s, true).unwrap_or(PhpMixed::Null)) + .map(|s| json_decode_assoc(s).unwrap_or(PhpMixed::Null)) .unwrap_or(PhpMixed::Null); let parsed_map: IndexMap<String, PhpMixed> = match parsed { PhpMixed::Array(m) => m.into_iter().collect(), |
