diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-04 21:47:27 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-04 21:47:27 +0900 |
| commit | 813a1b30aab5034512fd4ae4bee0acb1ece414dd (patch) | |
| tree | efdf352a705127ed4b1f2a80394cfb5ef7cda3c9 /crates/shirabe/src/package/root_package.rs | |
| parent | 06e8e14520a4a38fed500581d2b75a42418b22c4 (diff) | |
| download | php-shirabe-813a1b30aab5034512fd4ae4bee0acb1ece414dd.tar.gz php-shirabe-813a1b30aab5034512fd4ae4bee0acb1ece414dd.tar.zst php-shirabe-813a1b30aab5034512fd4ae4bee0acb1ece414dd.zip | |
feat(loader): wire ArrayLoader::load end-to-end (create_object/configure_object/dispatch)
Make ArrayLoader::load build and return a fully configured package for both
the CompletePackage and RootPackage class strings.
- Introduce a private CompleteOrRootPackage enum to model PHP's
createObject(): CompletePackage return (RootPackage extends CompletePackage),
with accessors for the inner Package, the CompletePackageInterface view, and
conversion into a PackageInterfaceHandle.
- create_object: instantiate CompletePackage/RootPackage by class string.
- load / configure_cached_links: implement the dynamic setter dispatch
($package->{'set'.ucfirst($method)}($links)) via apply_link_setter.
- configure_object: wire all ~21 setters (Package inherent + CompletePackageInterface),
source/dist with Mirror conversion, suggest self.version replacement, release
date, and the branch-alias return (RootAliasPackage/CompleteAliasPackage).
The PHP `instanceof CompletePackage` guard in configureObject is dropped: it is
unreachable since createObject is private and returns `: CompletePackage`, an
invariant now enforced at compile time by the enum. DateTime parsing for `time`
keeps its existing approximate scaffold (noted with a TODO).
RootPackage.inner is made pub(crate) (matching CompletePackage.inner) so the
loader can reach the core Package.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package/root_package.rs')
| -rw-r--r-- | crates/shirabe/src/package/root_package.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/shirabe/src/package/root_package.rs b/crates/shirabe/src/package/root_package.rs index c599612..0fd50f1 100644 --- a/crates/shirabe/src/package/root_package.rs +++ b/crates/shirabe/src/package/root_package.rs @@ -15,7 +15,7 @@ use crate::repository::RepositoryInterfaceHandle; #[derive(Debug, Clone)] pub struct RootPackage { - inner: CompletePackage, + pub(crate) inner: CompletePackage, pub(crate) minimum_stability: String, pub(crate) prefer_stable: bool, pub(crate) stability_flags: IndexMap<String, i64>, |
