aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/package/dumper
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-04 22:37:18 +0900
committernsfisis <nsfisis@gmail.com>2026-06-04 22:37:53 +0900
commit20d665bb1247500d514f05b160d01f5f8e223a38 (patch)
tree0d49d9f928021380b4c932f4f14272415afa9272 /crates/shirabe/src/package/dumper
parentf429396f1cada5b7096d12c3cfaeea113018406c (diff)
downloadphp-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.tar.gz
php-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.tar.zst
php-shirabe-20d665bb1247500d514f05b160d01f5f8e223a38.zip
feat(loader): wire RootPackageLoader::load end-to-end
Resolve the remaining todo!()/placeholder sites in RootPackageLoader::load so the root package loads with real data: - Unbox config at use sites and change load()'s parameter from IndexMap<String, Box<PhpMixed>> to IndexMap<String, PhpMixed>, matching ArrayLoader::load / VersionGuesser::guess_version and dropping the redundant box/unbox round-trip at the factory call site. - Expose replace_version through CompletePackage/RootPackage inherent delegation and a RootPackageHandle method (PHP Package::replaceVersion, inherited), and apply it for the auto-versioned default. - Collect require/require-dev links via getter dispatch and build the pretty-string map feeding extractAliases/StabilityFlags/References. Also reconcile the package repositories type with Config: change CompletePackageInterface::{get,set}_repositories from Vec<IndexMap<String, PhpMixed>> to IndexMap<String, PhpMixed> (PHP's array<int|string, mixed>), wire setRepositories(config.getRepositories()), and dump repositories verbatim as a keyed array (matching PHP ArrayDumper) instead of forcing a list. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/dumper')
-rw-r--r--crates/shirabe/src/package/dumper/array_dumper.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/shirabe/src/package/dumper/array_dumper.rs b/crates/shirabe/src/package/dumper/array_dumper.rs
index 3523d58..6a693bd 100644
--- a/crates/shirabe/src/package/dumper/array_dumper.rs
+++ b/crates/shirabe/src/package/dumper/array_dumper.rs
@@ -365,14 +365,10 @@ impl ArrayDumper {
if !repositories.is_empty() {
data.insert(
"repositories".to_string(),
- PhpMixed::List(
+ PhpMixed::Array(
repositories
.into_iter()
- .map(|r| {
- Box::new(PhpMixed::Array(
- r.into_iter().map(|(k, v)| (k, Box::new(v))).collect(),
- ))
- })
+ .map(|(k, v)| (k, Box::new(v)))
.collect(),
),
);