diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-08 04:22:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-08 04:23:11 +0900 |
| commit | 632c9793927a30c4bca3c91888e66b369d732dfe (patch) | |
| tree | 5bafb9d7fa2523d5a2f8d70ff59c3173e962e389 /crates/shirabe/src/dependency_resolver/solver.rs | |
| parent | 243450fee9853c2fea66ae0642dabb8db5227d6f (diff) | |
| download | php-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/dependency_resolver/solver.rs')
| -rw-r--r-- | crates/shirabe/src/dependency_resolver/solver.rs | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/crates/shirabe/src/dependency_resolver/solver.rs b/crates/shirabe/src/dependency_resolver/solver.rs index def586a..28e1e7f 100644 --- a/crates/shirabe/src/dependency_resolver/solver.rs +++ b/crates/shirabe/src/dependency_resolver/solver.rs @@ -211,23 +211,13 @@ impl Solver { .is_empty() { let mut problem = Problem::new(); - let mut reason_data: IndexMap<String, PhpMixed> = IndexMap::new(); - reason_data.insert( - "packageName".to_string(), - PhpMixed::String(package_name.clone()), - ); - // TODO(phase-b): store the constraint inside reason_data; PhpMixed needs to - // accept a `dyn ConstraintInterface` wrapper. - reason_data.insert("constraint".to_string(), PhpMixed::Null); problem.add_rule(Rc::new(RefCell::new(Rule::Generic(GenericRule::new( Vec::new(), - PhpMixed::Int(rule::RULE_ROOT_REQUIRE), - PhpMixed::Array( - reason_data - .into_iter() - .map(|(k, v)| (k, Box::new(v))) - .collect(), - ), + rule::RULE_ROOT_REQUIRE, + rule::ReasonData::RootRequire { + package_name: package_name.clone(), + constraint: active_constraint.clone(), + }, ))))); self.problems.push(problem); } @@ -620,8 +610,8 @@ impl Solver { array_unshift::<i64>(&mut other_learned_literals, learned_literal); let new_rule = GenericRule::new( other_learned_literals, - PhpMixed::Int(rule::RULE_LEARNED), - PhpMixed::Int(why), + rule::RULE_LEARNED, + rule::ReasonData::Int(why), ); Ok((learned_literal, rule_level, new_rule, why)) |
