aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/locker.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-08 04:22:49 +0900
committernsfisis <nsfisis@gmail.com>2026-06-08 04:23:11 +0900
commit632c9793927a30c4bca3c91888e66b369d732dfe (patch)
tree5bafb9d7fa2523d5a2f8d70ff59c3173e962e389 /crates/shirabe/src/package/locker.rs
parent243450fee9853c2fea66ae0642dabb8db5227d6f (diff)
downloadphp-shirabe-632c9793927a30c4bca3c91888e66b369d732dfe.tar.gz
php-shirabe-632c9793927a30c4bca3c91888e66b369d732dfe.tar.zst
php-shirabe-632c9793927a30c4bca3c91888e66b369d732dfe.zip
feat(phase-c): resolve PhpMixed-conversion phase-b TODOs
Implement the foundational PhpMixed conversion infrastructure (From<bool|i64|f64|String>, 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.
Diffstat (limited to 'crates/shirabe/src/package/locker.rs')
-rw-r--r--crates/shirabe/src/package/locker.rs6
1 files changed, 1 insertions, 5 deletions
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<String> {
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<String, PhpMixed> = 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()));
}
}