aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/perforce.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-16 12:51:24 +0900
committernsfisis <nsfisis@gmail.com>2026-08-16 12:51:24 +0900
commitfce44d4587ba11b080fe0266c483d0be684ffd0d (patch)
tree753e87ac7ed2e57d635a60c10a4ce01b7e0f0f8e /crates/shirabe/src/util/perforce.rs
parentb12c2b15f0487d54d359a581e99ced68713914d0 (diff)
downloadphp-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/perforce.rs')
-rw-r--r--crates/shirabe/src/util/perforce.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/util/perforce.rs b/crates/shirabe/src/util/perforce.rs
index fbab6889..c0cd5a08 100644
--- a/crates/shirabe/src/util/perforce.rs
+++ b/crates/shirabe/src/util/perforce.rs
@@ -9,7 +9,7 @@ use indexmap::IndexMap;
use shirabe_pcre::Preg;
use shirabe_php_shim::{
Exception, PHP_EOL, PhpMixed, PhpResource, chdir, date_local, explode, fclose, feof, fgets,
- file_get_contents, fopen, fwrite, gethostname, json_decode, php_regex, str_replace_array,
+ file_get_contents, fopen, fwrite, gethostname, json_decode_assoc, php_regex, str_replace_array,
strcmp, strlen, strpos, strrpos, substr, time, trim,
};
use shirabe_symfony_process::ExecutableFinder;
@@ -577,7 +577,7 @@ impl Perforce {
Some(s) => s,
};
- let decoded = json_decode(&composer_file_content, true)?;
+ let decoded = json_decode_assoc(&composer_file_content)?;
Ok(match decoded {
PhpMixed::Array(m) => Some(m.into_iter().collect()),
_ => None,