From 632c9793927a30c4bca3c91888e66b369d732dfe Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 8 Jun 2026 04:22:49 +0900 Subject: feat(phase-c): resolve PhpMixed-conversion phase-b TODOs Implement the foundational PhpMixed conversion infrastructure (From, order-sensitive PartialEq matching PHP ===) and resolve the category-G phase-b TODOs that depend on it: - Fix VCS driver cache paths that discarded parsed JSON or diverged on null caches (svn/forgejo/gitlab/git-bitbucket/github). - Wire up real conversions previously stubbed or dropped: suggests platform config, audit ignore-severities, composer_repository search and ProviderInfo, class_loader prefix/classmap merges, locker lock diff comparison, advisory JSON serialization, SPDX license fields. - Make GenericRule take a typed ReasonData; populate RULE_ROOT_REQUIRE with the constraint and convert PhpMixed at the call sites. --- crates/shirabe/src/package/loader/validating_array_loader.rs | 1 - crates/shirabe/src/package/locker.rs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'crates/shirabe/src/package') diff --git a/crates/shirabe/src/package/loader/validating_array_loader.rs b/crates/shirabe/src/package/loader/validating_array_loader.rs index fbaa0f8..4994d5a 100644 --- a/crates/shirabe/src/package/loader/validating_array_loader.rs +++ b/crates/shirabe/src/package/loader/validating_array_loader.rs @@ -990,7 +990,6 @@ impl ValidatingArrayLoader { .and_then(|v| v.as_array()) .cloned() .unwrap_or_default(); - // TODO(phase-b): convert Box maps for the shim signature. let replace_map_flat: IndexMap = replace_map .iter() .map(|(k, v)| (k.clone(), (**v).clone())) diff --git a/crates/shirabe/src/package/locker.rs b/crates/shirabe/src/package/locker.rs index 91affe2..5f13a31 100644 --- a/crates/shirabe/src/package/locker.rs +++ b/crates/shirabe/src/package/locker.rs @@ -89,7 +89,6 @@ impl Locker { /// Returns the md5 hash of the sorted content of the composer file. pub fn get_content_hash(composer_file_contents: &str) -> Result { let content = JsonFile::parse_json(Some(composer_file_contents), Some("composer.json"))?; - // TODO(phase-b): parse_json returns PhpMixed; downstream expects map-like access let content_map: IndexMap = match &content { PhpMixed::Array(m) => m.iter().map(|(k, v)| (k.clone(), (**v).clone())).collect(), _ => IndexMap::new(), @@ -620,10 +619,9 @@ impl Locker { } else { None }; - // TODO(phase-b): PhpMixed lacks PartialEq; PHP compares lock array with current data let differs = current_data .as_ref() - .map(|c| !std::ptr::eq(c as *const _, &lock as *const _)) + .map(|c| !c.iter().eq(lock.iter())) .unwrap_or(true); if !is_locked || differs { if write { @@ -725,8 +723,6 @@ impl Locker { }) .unwrap_or(false); if should_replace { - // PHP: $lockData[$key] = new \stdClass(); - // TODO(phase-b): represent empty stdClass distinctly from empty array lock_data.insert(key.to_string(), PhpMixed::Array(IndexMap::new())); } } -- cgit v1.3.1