aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/installer/installer_event.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-22 01:29:48 +0900
committernsfisis <nsfisis@gmail.com>2026-05-22 01:43:48 +0900
commit0b06f54103490e3ce5658e82bbc0119633e26cd8 (patch)
tree687b075131d3679725e77e0931ff7c503a6c3034 /crates/shirabe/src/installer/installer_event.rs
parent2914770fba6b3cc03a68fae493f60470a41962ec (diff)
downloadphp-shirabe-0b06f54103490e3ce5658e82bbc0119633e26cd8.tar.gz
php-shirabe-0b06f54103490e3ce5658e82bbc0119633e26cd8.tar.zst
php-shirabe-0b06f54103490e3ce5658e82bbc0119633e26cd8.zip
refactor(composer): unify Composer/PartialComposer via Rc handles
Model PHP's `Composer extends PartialComposer` as a PartialOrFullComposer enum and merge partial_composer.rs into composer.rs. Introduce ComposerHandle / PartialComposerHandle (plus their Weak variants) so the graph can be shared, and build it at once with Rc::new_cyclic in the factory to resolve the back-reference cycles. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer/installer_event.rs')
-rw-r--r--crates/shirabe/src/installer/installer_event.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/installer/installer_event.rs b/crates/shirabe/src/installer/installer_event.rs
index 6d4bf0b..3c02b7f 100644
--- a/crates/shirabe/src/installer/installer_event.rs
+++ b/crates/shirabe/src/installer/installer_event.rs
@@ -1,6 +1,6 @@
//! ref: composer/src/Composer/Installer/InstallerEvent.php
-use crate::composer::Composer;
+use crate::composer::ComposerWeakHandle;
use crate::dependency_resolver::Transaction;
use crate::event_dispatcher::Event;
use crate::io::IOInterface;
@@ -8,7 +8,7 @@ use crate::io::IOInterface;
#[derive(Debug)]
pub struct InstallerEvent {
inner: Event,
- composer: Composer,
+ composer: ComposerWeakHandle,
io: Box<dyn IOInterface>,
dev_mode: bool,
execute_operations: bool,
@@ -18,7 +18,7 @@ pub struct InstallerEvent {
impl InstallerEvent {
pub fn new(
event_name: String,
- composer: Composer,
+ composer: ComposerWeakHandle,
io: Box<dyn IOInterface>,
dev_mode: bool,
execute_operations: bool,
@@ -35,7 +35,7 @@ impl InstallerEvent {
}
}
- pub fn get_composer(&self) -> &Composer {
+ pub fn get_composer(&self) -> &ComposerWeakHandle {
&self.composer
}