aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/json.rs
AgeCommit message (Collapse)Author
2026-06-27refactor: fix compiler warnings and clippy warningsnsfisis
2026-06-24feat(php-shim): support JSON_PRETTY_PRINT in json_encode_exnsfisis
PHP's JSON_PRETTY_PRINT uses a 4-space indent, so use serde_json's PrettyFormatter with a 4-space indent when the flag is set.
2026-06-21refactor(php-shim): remove ArrayObject, inline IndexMap into PhpMixed::Objectnsfisis
ArrayObject was only a thin wrapper around IndexMap<String, PhpMixed> used as an empty-{} vs empty-[] marker and as the assoc=false JSON object representation; no reference semantics were involved. Inline its payload directly into PhpMixed::Object and drop the type along with the now-dead StdClass. Side effects of the unification: - ArrayObject::new was todo!(); the config --global / object-typed get paths that built PhpMixed::Object(ArrayObject::new(None)) no longer panic. - base_config_command wrote 'config' as PhpMixed::Array(empty), emitting [] instead of {}; now matches PHP's new \ArrayObject ({}). - The dead is::<StdClass>()/is::<ArrayObject>() instanceof checks in JsonManipulator are replaced with the faithful as_object() mapping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21refactor(json): eliminate json_last_error in favor of Resultnsfisis
json_encode/json_encode_ex now return anyhow::Result<String> instead of Option, so callers no longer need json_last_error() to get the failure reason. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21refactor(php-shim): split lib.rsnsfisis